\input{preamble}

% OK, start here.
%
\begin{document}

\title{Semistable Reduction}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
In this chapter we prove the semistable reduction theorem for curves.
We will use the method of Artin and Winters from their paper
\cite{Artin-Winters}.

\medskip\noindent
It turns out that one can prove the semistable reduction theorem
for curves without any results on desingularization. Namely, there
is a way to establish the existence and projectivity of moduli
of semistable curves using Geometric Invariant Theory (GIT)
as developed by Mumford, see \cite{GIT}. This method was
championed by Gieseker who proved the full result in his
lecture notes \cite{Gieseker}\footnote{Gieseker's lecture notes
are written over an algebraically closed field, but the same method
works over $\mathbf{Z}$.}. This is quite an amazing
feat: it seems somewhat counter intuitive that one can
prove such a result without ever truly studying families of curves over
a positive dimensional base.

\medskip\noindent
Historically the first proof of the semistable reduction theorem
for curves can be found in the paper \cite{DM} by Deligne and Mumford.
It proves the theorem by reducing the problem to the case of
Abelian varieties which was already known at the time thanks
to Grothendieck and others, see \cite{SGA7-I} and \cite{SGA7-II}).
The semistable reduction theorem for abelian varieties uses the theory
of N\'eron models which in turn rests on a treatment of birational
group laws over a base.

\medskip\noindent
The method in the paper by Artin and Winters relies on desingularization
of singularities of surfaces to obtain regular models. Given the existence
of regular models, the proof consists in analyzing the
possibilities for the special fibre and concluding using an inequality
for torsion in the Picard group of a $1$-dimensional scheme over a field.
A similar argument can be found in a paper \cite{Saito} of Saito who uses
\'etale cohomology directly and who obtains a stronger result in that
he can characterize semistable reduction in terms of the action of
the inertia on $\ell$-adic \'etale cohomology.

\medskip\noindent
A different approach one can use to prove the theorem is to use
rigid analytic geometry techniques. Here we refer the reader to
\cite{vanderPut} and \cite{Arzdorf-Wewers}.

\medskip\noindent
The paper \cite{Temkin} by Temkin uses valuation theoretic techniques
(and proves a lot more besides); also Appendix A of this paper gives
a nice overview of the different proofs and the relationship with
desingularizations of $2$ dimensional schemes.

\medskip\noindent
Another overview paper that the reader may wish to consult is
\cite{Abbes-ssr} written by Ahmed Abbes.






\section{Linear algebra}
\label{section-linear-algebra}

\noindent
A couple of lemmas we will use later on.

\begin{lemma}
\label{lemma-recurring}
\begin{reference}
\cite[Theorem I]{Taussky}
\end{reference}
Let $A = (a_{ij})$ be a complex $n \times n$ matrix.
\begin{enumerate}
\item If $|a_{ii}| > \sum_{j \not = i} |a_{ij}|$ for each $i$, then
$\det(A)$ is nonzero.
\item If there exists a real vector $m = (m_1, \ldots, m_n)$
with $m_i > 0$ such that $|a_{ii} m_i| > \sum_{j \not = i} |a_{ij}m_j|$
for each $i$, then $\det(A)$ is nonzero.
\end{enumerate}
\end{lemma}

\begin{proof}
If $A$ is as in (1) and $\det(A) = 0$, then there is a nonzero vector
$z$ with $Az = 0$. Choose $r$ with $|z_r|$ maximal. Then
$$
|a_{rr} z_r| = |\sum\nolimits_{k \not = r} a_{rk}z_k| \leq
\sum\nolimits_{k \not = r} |a_{rk}||z_k| \leq
|z_r| \sum\nolimits_{k \not = r} |a_{rk}| < |a_{rr}||z_r|
$$
which is a contradiction. To prove (2) apply (1) to the matrix
$(a_{ij}m_j)$ whose determinant is $m_1 \ldots m_n \det(A)$.
\end{proof}

\begin{lemma}
\label{lemma-recurring-real}
Let $A = (a_{ij})$ be a real $n \times n$ matrix with
$a_{ij} \geq 0$ for $i \not = j$. Let $m = (m_1, \ldots, m_n)$ be a real
vector with $m_i > 0$. For $I \subset \{1, \ldots, n\}$ let
$x_I \in \mathbf{R}^n$
be the vector whose $i$th coordinate is $m_i$ if $i \in I$
and $0$ otherwise. If
\begin{equation}
\label{equation-ineq}
-a_{ii}m_i \geq \sum\nolimits_{j \not = i} a_{ij}m_j
\end{equation}
for each $i$, then $\Ker(A)$ is the vector space
spanned by the vectors $x_I$ such that
\begin{enumerate}
\item $a_{ij} = 0$ for $i \in I$, $j \not \in I$, and
\item equality holds in (\ref{equation-ineq}) for $i \in I$.
\end{enumerate}
\end{lemma}

\begin{proof}
After replacing $a_{ij}$ by $a_{ij}m_j$ we may assume $m_i = 1$ for all $i$.
If $I \subset \{1, \ldots, n\}$ such that (1) and (2) are true,
then a simple computation shows that $x_I$ is in the kernel of $A$.
Conversely, let $x = (x_1, \ldots, x_n) \in \mathbf{R}^n$ be a
nonzero vector in the kernel of $A$. We will show by induction
on the number of nonzero coordinates of $x$ that $x$ is in the
span of the vectors $x_I$ satisfying (1) and (2). Let
$I \subset \{1, \ldots, n\}$ be the set of indices $r$ with $|x_r|$ maximal.
For $r \in I$ we have
$$
|a_{rr} x_r| = |\sum\nolimits_{k \not = r} a_{rk}x_k| \leq
\sum\nolimits_{k \not = r} a_{rk}|x_k| \leq
|x_r| \sum\nolimits_{k \not = r} a_{rk} \leq |a_{rr}||x_r|
$$
Thus equality holds everywhere. In particular, we see that
$a_{rk} = 0$ if $r \in I$, $k \not \in I$ and equality holds
in (\ref{equation-ineq}) for $r \in I$. Then we see that we
can substract a suitable multiple of $x_I$ from $x$ to decrease
the number of nonzero coordinates.
\end{proof}

\begin{lemma}
\label{lemma-recurring-symmetric-real}
Let $A = (a_{ij})$ be a symmetric real $n \times n$ matrix with
$a_{ij} \geq 0$ for $i \not = j$.
Let $m = (m_1, \ldots, m_n)$ be a real vector with $m_i > 0$.
Assume
\begin{enumerate}
\item $Am = 0$,
\item there is no proper nonempty subset $I \subset \{1, \ldots, n\}$
such that $a_{ij} = 0$ for $i \in I$ and $j \not \in I$.
\end{enumerate}
Then $x^t A x \leq 0$ with equality if and only if $x = qm$
for some $q \in \mathbf{R}$.
\end{lemma}

\begin{proof}[First proof]
After replacing $a_{ij}$ by $a_{ij}m_im_j$ we may assume $m_i = 1$
for all $i$. Condition (1) means $-a_{ii} = \sum_{j \not = i} a_{ij}$
for all $i$. Recall that $x^tAx = \sum_{i, j} x_ia_{ij}x_j$.
Then
\begin{align*}
\sum\nolimits_{i \not = j} -a_{ij}(x_j - x_i)^2 & =
\sum\nolimits_{i \not = j} -a_{ij}x_j^2 + 2a_{ij}x_ix_i - a_{ij}x_i^2 \\
& =
\sum\nolimits_j a_{jj} x_j^2 +
\sum\nolimits_{i \not = j} 2a_{ij}x_ix_i +
\sum\nolimits_j a_{jj} x_i^2 \\
& = 2x^tAx
\end{align*}
This is clearly $\leq 0$. If equality holds, then let $I$ be the set
of indices $i$ with $x_i \not = x_1$. Then $a_{ij} = 0$ for $i \in I$
and $j \not \in I$. Thus $I = \{1, \ldots, n\}$ by condition (2) and
$x$ is a multiple of $m = (1, \ldots, 1)$.
\end{proof}

\begin{proof}[Second proof]
The matrix $A$ has real eigenvalues by the spectral theorem.
We claim all the eigenvalues are $\leq 0$.
Namely, since property (1) means
$-a_{ii}m_i = \sum_{j \not = i} a_{ij}m_j$ for all $i$,
we find that the matrix $A' = A - \lambda I$ for $\lambda > 0$
satisfies $|a'_{ii}m_i| > \sum a'_{ij}m_j = \sum |a'_{ij}m_j|$ for all $i$.
Hence $A'$ is invertible by Lemma \ref{lemma-recurring}.
This implies that the symmetric bilinear form $x^tAy$
is semi-negative definite, i.e., $x^tAx \leq 0$ for all $x$.
It follows that the kernel of $A$ is equal
to the set of vectors $x$ with $x^tAx = 0$.
The description of the kernel in Lemma \ref{lemma-recurring-real}
gives the final statement of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-orthogonal-direct-sum}
Let $L$ be a finite free $\mathbf{Z}$-module endowed
with an integral symmetric bilinear positive definite
form $\langle\ ,\ \rangle : L \times L \to \mathbf{Z}$.
Let $A \subset L$ be a submodule with $L/A$ torsion free. Set
$B = \{b \in L \mid \langle a, b\rangle = 0,\ \forall a \in A\}$.
Then we have injective maps
$$
A^\#/A \leftarrow L/(A \oplus B) \rightarrow B^\#/B
$$
whose cokernels are quotients of $L^\#/L$. Here
$A^\# = \{a' \in A \otimes \mathbf{Q} \mid
\langle a, a'\rangle \in \mathbf{Z},\ \forall a \in A\}$
and similarly for $B$ and $L$.
\end{lemma}

\begin{proof}
Observe that
$L \otimes \mathbf{Q} = A \otimes \mathbf{Q} \oplus B \otimes \mathbf{Q}$
because the form is nondegenerate on $A$ (by positivity).
We denote $\pi_B : L \otimes \mathbf{Q} \to B \otimes \mathbf{Q}$
the projection. Observe that $\pi_B(x) \in B^\#$ for $x \in L$
because the form is integral. This gives an exact sequence
$$
0 \to A \to L \xrightarrow{\pi_B} B^\# \to Q \to 0
$$
where $Q$ is the cokernel of $L \to B^\#$. Observe that $Q$
is a quotient of $L^\#/L$ as the map $L^\# \to B^\#$ is surjective
since it is the $\mathbf{Z}$-linear dual to $B \to L$ which is split
as a map of $\mathbf{Z}$-modules.
Dividing by $A \oplus B$ we get a short exact sequence
$$
0 \to L/(A \oplus B) \to B^\#/B \to Q \to 0
$$
This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-coker}
Let $L_0$, $L_1$ be a finite free $\mathbf{Z}$-modules endowed
with integral symmetric bilinear positive definite
forms $\langle\ ,\ \rangle : L_i \times L_i \to \mathbf{Z}$.
Let $\text{d} : L_0 \to L_1$ and $\text{d}^* : L_1 \to L_0$
be adjoint. If $\langle\ ,\ \rangle$ on $L_0$ is unimodular, then
there is an isomorphism
$$
\Phi :
\Coker(\text{d}^*\text{d})_{torsion}
\longrightarrow
\Im(\text{d})^\#/\Im(\text{d})
$$
with notation as in Lemma \ref{lemma-orthogonal-direct-sum}.
\end{lemma}

\begin{proof}
Let $x \in L_0$ be an element representing a torsion
class in $\Coker(\text{d}^*\text{d})$.
Then for some $a > 0$ we can write $ax = \text{d}^*\text{d}(y)$.
For any $z \in \Im(\text{d})$, say $z = \text{d}(y')$, we have
$$
\langle (1/a)\text{d}(y), z \rangle =
\langle (1/a)\text{d}(y), \text{d}(y') \rangle =
\langle x, y' \rangle \in \mathbf{Z}
$$
Hence $(1/a)\text{d}(y) \in \Im(\text{d})^\#$. We define
$\Phi(x) = (1/a)\text{d}(y) \bmod \Im(\text{d})$.
We omit the proof that $\Phi$ is well defined, additive, and injective.

\medskip\noindent
To prove $\Phi$ is surjective, let $z \in \Im(\text{d})^\#$.
Then $z$ defines a linear map $L_0 \to \mathbf{Z}$
by the rule $x \mapsto \langle z, \text{d}(x)\rangle$.
Since the pairing on $L_0$ is unimodular by assumption
we can find an $x' \in L_0$ with
$\langle x', x \rangle = \langle z, \text{d}(x)\rangle$
for all $x \in L_0$. In particular, we see
that $x'$ pairs to zero with $\Ker(\text{d})$.
Since $\Im(\text{d}^*\text{d}) \otimes \mathbf{Q}$
is the orthogonal complement of $\Ker(\text{d}) \otimes \mathbf{Q}$
this means that $x'$ defines a torsion class in
$\Coker(\text{d}^*\text{d})$. We claim that $\Phi(x') = z$.
Namely, write $a x' = \text{d}^*\text{d}(y)$
for some $y \in L_0$ and $a > 0$.
For any $x \in L_0$ we get
$$
\langle z, \text{d}(x)\rangle =
\langle x', x \rangle =
\langle (1/a)\text{d}^*\text{d}(y), x \rangle =
\langle (1/a)\text{d}(y),\text{d}(x) \rangle
$$
Hence $z = \Phi(x')$ and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-recurring-symmetric-integer}
Let $A = (a_{ij})$ be a symmetric $n \times n$ integer matrix with
$a_{ij} \geq 0$ for $i \not = j$. Let $m = (m_1, \ldots, m_n)$ be an
integer vector with $m_i > 0$. Assume
\begin{enumerate}
\item $Am = 0$,
\item there is no proper nonempty subset $I \subset \{1, \ldots, n\}$
such that $a_{ij} = 0$ for $i \in I$ and $j \not \in I$.
\end{enumerate}
Let $e$ be the number of pairs $(i, j)$ with $i < j$ and $a_{ij} > 0$.
Then for $\ell$ a prime number coprime with all $a_{ij}$ and $m_i$
we have
$$
\dim_{\mathbf{F}_\ell}(\Coker(A)[\ell]) \leq 1 - n + e
$$
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-recurring-symmetric-real} the rank of $A$ is $n - 1$.
The composition
$$
\mathbf{Z}^{\oplus n} \xrightarrow{\text{diag}(m_1, \ldots, m_n)}
\mathbf{Z}^{\oplus n} \xrightarrow{(a_{ij})}
\mathbf{Z}^{\oplus n} \xrightarrow{\text{diag}(m_1, \ldots, m_n)}
\mathbf{Z}^{\oplus n}
$$
has matrix $a_{ij}m_im_j$. Since the cokernel of the first and last
maps are torsion of order prime to $\ell$ by our restriction on $\ell$
we see that it suffices to prove the lemma for the matrix
with entries $a_{ij}m_im_j$. Thus we may assume $m = (1, \ldots, 1)$.

\medskip\noindent
Assume $m = (1, \ldots, 1)$. Set $V = \{1, \ldots, n\}$ and
$E = \{(i, j) \mid i < j\text{ and }a_{ij} > 0\}$. For
$e = (i, j) \in E$ set $a_e = a_{ij}$. Define maps
$s, t : E \to V$ by setting $s(i, j) = i$ and $t(i, j) = j$.
Set
$\mathbf{Z}(V) = \bigoplus_{i \in V} \mathbf{Z}i$ and
$\mathbf{Z}(E) = \bigoplus_{e \in E} \mathbf{Z}e$.
We define symmetric positive definite integer valued pairings
on $\mathbf{Z}(V)$ and $\mathbf{Z}(E)$ by setting
$$
\langle i, i \rangle = 1\text{ for }i \in V, \quad
\langle e, e \rangle = a_e\text{ for }e \in E
$$
and all other pairings zero. Consider the maps
$$
\text{d} : \mathbf{Z}(V) \to \mathbf{Z}(E), \quad
i \longmapsto
\sum\nolimits_{e \in E,\ s(e) = i} e - \sum\nolimits_{e \in E,\ t(e) = i} e
$$
and
$$
\text{d}^*(e) = a_e(s(e) - t(e))
$$
A computation shows that
$$
\langle d(x), y\rangle = \langle x, \text{d}^*(y) \rangle
$$
in other words, $\text{d}$ and $\text{d}^*$ are adjoint. Next we compute
\begin{align*}
\text{d}^*\text{d}(i)
& = 
\text{d}^*(
\sum\nolimits_{e \in E,\ s(e) = i} e - \sum\nolimits_{e \in E,\ t(e) = i} e) \\
& =
\sum\nolimits_{e \in E,\ s(e) = i} a_e(s(e) - t(e)) -
\sum\nolimits_{e \in E,\ t(e) = i} a_e(s(e) - t(e))
\end{align*}
The coefficient of $i$ in $\text{d}^*\text{d}(i)$ is
$$
\sum\nolimits_{e \in E,\ s(e) = i} a_e +
\sum\nolimits_{e \in E,\ t(e) = i} a_e = - a_{ii}
$$
because $\sum_j a_{ij} = 0$ and the coefficient of
$j \not = i$ in $\text{d}^*\text{d}(i)$ is $-a_{ij}$.
Hence $\Coker(A) = \Coker(\text{d}^*\text{d})$.

\medskip\noindent
Consider the inclusion
$$
\Im(\text{d}) \oplus \Ker(\text{d}^*) \subset \mathbf{Z}(E)
$$
The left hand side is an orthogonal direct sum. Clearly
$\mathbf{Z}(E)/\Ker(\text{d}^*)$ is torsion free.
We claim $\mathbf{Z}(E)/\Im(\text{d})$ is torsion free as well.
Namely, say $x = \sum x_e e \in \mathbf{Z}(E)$ and $a > 1$ are such
that $ax = \text{d}y$ for some $y = \sum y_i i \in \mathbf{Z}(V)$.
Then $a x_e = y_{s(e)} - y_{t(e)}$. By property (2) we conclude
that all $y_i$ have the same congruence class modulo $a$.
Hence we can write $y = a y' + (y_1, y_1, \ldots, y_1)$.
Since $\text{d}(y_1, y_1, \ldots, y_1) = 0$ we conclude
that $x = \text{d}(y')$ which is what we had to show.

\medskip\noindent
Hence we may apply Lemma \ref{lemma-orthogonal-direct-sum}
to get injective maps
$$
\Im(\text{d})^\#/\Im(\text{d}) \leftarrow
\mathbf{Z}(E)/(\Im(\text{d}) \oplus \Ker(\text{d}^*)) \rightarrow
\Ker(\text{d}^*)^\#/\Ker(\text{d}^*)
$$
whose cokernels are annihilated by the product of the $a_e$
(which is prime to $\ell$). Since $\Ker(\text{d}^*)$ is
a lattice of rank $1 - n + e$ we see that the proof is complete
if we prove that there exists an isomorphism
$$
\Phi : M_{torsion} \longrightarrow \Im(\text{d})^\#/\Im(\text{d})
$$
This is proved in Lemma \ref{lemma-coker}.
\end{proof}









\section{Numerical types}
\label{section-numerical-types}

\noindent
Part of the arguments will involve the combinatorics of the following
data structures.

\begin{definition}
\label{definition-type}
A {\it numerical type} $T$ is given by
$$
n, m_i, a_{ij}, w_i, g_i
$$
where $n \geq 1$ is an integer and $m_i$, $a_{ij}$, $w_i$, $g_i$
are integers for $1 \leq i, j \leq n$ subject to the following conditions
\begin{enumerate}
\item $m_i > 0$, $w_i > 0$, $g_i \geq 0$,
\item the matrix $A = (a_{ij})$ is symmetric and $a_{ij} \geq 0$
for $i \not = j$,
\item there is no proper nonempty subset $I \subset \{1, \ldots, n\}$
such that $a_{ij} = 0$ for $i \in I$, $j \not \in I$,
\item for each $i$ we have $\sum_j a_{ij}m_j = 0$, and
\item $w_i | a_{ij}$.
\end{enumerate}
\end{definition}

\noindent
This is obviously a somewhat annoying type of structure to work with,
but it is exactly what shows up in special fibres of proper regular
models of smooth geometrically connected curves.
Of course we only care about these types up to reordering the indices.

\begin{definition}
\label{definition-type-equivalent}
We say two numerical types $n, m_i, a_{ij}, w_i, g_i$ and
$n', m'_i, a'_{ij}, w'_i, g'_i$ are {\it equivalent types} if
there exists a permutation $\sigma$ of $\{1, \ldots, n\}$
such that $m_i = m'_{\sigma(i)}$, $a_{ij} = a'_{\sigma(i)\sigma(j)}$,
$w_i = w'_{\sigma(i)}$, and $g_i = g'_{\sigma(i)}$.
\end{definition}

\noindent
A numerical type has a genus.

\begin{lemma}
\label{lemma-genus}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type. Then the expression
$$
g = 1 + \sum m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii})
$$
is an integer.
\end{lemma}

\begin{proof}
To prove $g$ is an integer we have to show that $\sum a_{ii}m_i$ is even.
This we can see by computing modulo $2$ as follows
\begin{align*}
\sum\nolimits_i a_{ii} m_i 
& \equiv
\sum\nolimits_{i,\ m_i\text{ odd}} a_{ii}m_i \\
& \equiv
\sum\nolimits_{i,\ m_i\text{ odd}} \sum\nolimits_{j \not = i} a_{ij}m_j \\
& \equiv
\sum\nolimits_{i,\ m_i\text{ odd}}
\sum\nolimits_{j \not = i,\ m_j\text{ odd}} a_{ij}m_j \\
& \equiv
\sum\nolimits_{i < j,\ m_i\text{ and }m_j\text{ odd}} a_{ij}(m_i + m_j) \\
& \equiv
0
\end{align*}
where we have used that $a_{ij} = a_{ji}$ and that $\sum_j a_{ij}m_j = 0$
for all $i$.
\end{proof}

\begin{definition}
\label{definition-genus}
We say $n, m_i, a_{ij}, w_i, g_i$ is a {\it numerical type of genus $g$}
if $g = 1 + \sum m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii})$ is the integer
from Lemma \ref{lemma-genus}.
\end{definition}

\noindent
We will prove below (Lemma \ref{lemma-genus-nonnegative}) that the genus
is almost always $\geq 0$. But you can have numerical types with
negative genus.

\begin{lemma}
\label{lemma-irreducible}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
If $n = 1$, then $a_{11} = 0$ and $g = 1 + m_1w_1(g_1 - 1)$.
Moreover, we can classify all such numerical types as follows
\begin{enumerate}
\item If $g < 0$, then $g_1 = 0$ and there are finitely many possible
numerical types of genus $g$ with $n = 1$ corresponding to factorizations
$m_1w_1 = 1 - g$.
\item If $g = 0$, then $m_1 = 1$, $w_1 = 1$, $g_1 = 0$
as in Lemma \ref{lemma-genus-zero}.
\item If $g = 1$, then we conclude $g_1 = 1$ but $m_1, w_1$ can be arbitrary
positive integers; this is case
(\ref{item-one}) of Lemma \ref{lemma-genus-one}.
\item If $g > 1$, then $g_1 > 1$ and there are finitely many possible
numerical types of genus $g$ with $n = 1$ corresponding to
factorizations $m_1w_1(g_1 - 1) = g - 1$.
\end{enumerate}
\end{lemma}

\begin{proof}
The lemma proves itself.
\end{proof}

\begin{lemma}
\label{lemma-diagonal-negative}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
If $n > 1$, then $a_{ii} < 0$ for all $i$.
\end{lemma}

\begin{proof}
Lemma \ref{lemma-recurring-symmetric-real} applies to the matrix $A$.
\end{proof}

\begin{lemma}
\label{lemma-minus-one}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
Assume $n > 1$. If $i$ is such that the contribution
$m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii})$
to the genus $g$ is $< 0$, then $g_i = 0$ and $a_{ii} = -w_i$.
\end{lemma}

\begin{proof}
Follows immediately from Lemma \ref{lemma-diagonal-negative} and
$w_i > 0$, $g_i \geq 0$, and $w_i | a_{ii}$.
\end{proof}

\begin{definition}
\label{definition-type-minus-one}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type.
We say $i$ is a {\it $(-1)$-index} if $g_i = 0$ and $a_{ii} = -w_i$.
\end{definition}

\noindent
We can ``contract'' $(-1)$-indices.

\begin{lemma}
\label{lemma-contract}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$.
Assume $n$ is a $(-1)$-index. Then there is a numerical
type $T'$ given by $n', m'_i, a'_{ij}, w'_i, g'_i$ with
\begin{enumerate}
\item $n' = n - 1$,
\item $m'_i = m_i$,
\item $a'_{ij} = a_{ij} - a_{in}a_{jn}/a_{nn}$,
\item $w'_i = w_i/2$ if $a_{in}/w_n$ even and $a_{in}/w_i$ odd
and $w'_i = w_i$ else,
\item $g'_i =
\frac{w_i}{w'_i}(g_i - 1) + 1 + \frac{a_{in}^2 - w_na_{in}}{2w'_iw_n}$.
\end{enumerate}
Moreover, we have $g = g'$.
\end{lemma}

\begin{proof}
Observe that $n > 1$ for example by Lemma \ref{lemma-irreducible}
and hence $n' \geq 1$. We check conditions (1) -- (5) of
Definition \ref{definition-type} for $n', m'_i, a'_{ij}, w'_i, g'_i$.

\medskip\noindent
Condition (1) is immediate.

\medskip\noindent
Condition (2). Symmetry of $A' = (a'_{ij})$ is immediate
and since $a_{nn} < 0$ by Lemma \ref{lemma-diagonal-negative}
we see that $a'_{ij} \geq a_{ij} \geq 0$ if $i \not = j$.

\medskip\noindent
Condition (3). Suppose that $I \subset \{1, \ldots, n - 1\}$ such that
$a'_{ii'} = 0$ for $i \in I$ and $i' \in \{1, \ldots, n - 1\} \setminus I$.
Then we see that for each $i \in I$ and $i' \in I'$ we have
$a_{in}a_{i'n} = 0$. Thus either $a_{in} = 0$ for all $i \in I$ and
$I \subset \{1, \ldots, n\}$ is a contradiction for property (3) for $T$,
or $a_{i'n} = 0$ for all $i' \in \{1, \ldots, n - 1\} \setminus I$
and $I \cup \{n\} \subset \{1, \ldots, n\}$ is a contradiction for
property (3) of $T$. Hence (3) holds for $T'$.

\medskip\noindent
Condition (4). We compute
$$
\sum\nolimits_{j = 1}^{n - 1} a'_{ij}m_j =
\sum\nolimits_{j = 1}^{n - 1}
(a_{ij}m_j - \frac{a_{in}a_{jn}m_j}{a_{nn}}) =
- a_{in}m_n - \frac{a_{in}}{a_{nn}}(-a_{nn}m_n) = 0
$$
as desired.

\medskip\noindent
Condition (5). We have to show that $w'_i$ divides $a_{in}a_{jn}/a_{nn}$.
This is clear because $a_{nn} = -w_n$ and $w_n | a_{jn}$ and $w_i | a_{in}$.

\medskip\noindent
To show that $g = g'$ we first write
\begin{align*}
g
& =
1 + \sum\nolimits_{i = 1}^n m_i(w_i(g_i - 1) - \frac{1}{2}a_{ii}) \\
& =
1 + \sum\nolimits_{i = 1}^{n - 1} m_i(w_i(g_i - 1) - \frac{1}{2}a_{ii})
-\frac{1}{2}m_nw_n \\
& =
1 +  \sum\nolimits_{i = 1}^{n - 1}
m_i(w_i(g_i - 1) - \frac{1}{2}a_{ii} - \frac{1}{2}a_{in})
\end{align*}
Comparing with the expression for $g'$ we see that it suffices if
$$
w'_i(g'_i - 1) - \frac{1}{2}a'_{ii} =
w_i(g_i - 1) - \frac{1}{2}a_{in} - \frac{1}{2}a_{ii}
$$
for $i \leq n - 1$. In other words, we have
$$
g'_i = \frac{2w_i(g_i - 1) - a_{in} - a_{ii} + a'_{ii} + 2w'_i}{2w'_i} =
\frac{w_i}{w'_i}(g_i - 1) + 1 + \frac{a_{in}^2 - w_na_{in}}{2w'_iw_n}
$$
It is elementary to check that this is an integer $\geq 0$
if we choose $w'_i$ as in (4).
\end{proof}

\begin{lemma}
\label{lemma-top-genus}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type.
Let $e$ be the number of pairs $(i, j)$ with $i < j$ and $a_{ij} > 0$.
Then the expression $g_{top} = 1 - n + e$ is $\geq 0$.
\end{lemma}

\begin{proof}
If not, then $e < n - 1$ which means there exists an $i$ such that
$a_{ij} = 0$ for all $j \not = i$. This contradicts assumption
(3) of Definition \ref{definition-type}.
\end{proof}

\begin{definition}
\label{definition-top-genus}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$. The
{\it topological genus of $T$} is the nonnegative integer
$g_{top} = 1 - n + e$ from Lemma \ref{lemma-top-genus}.
\end{definition}

\noindent
We want to bound the genus by the topological genus. However, this
will not always be the case, for example for numerical types
with $n = 1$ as in Lemma \ref{lemma-irreducible}. But it will
be true for minimal numerical types which are defined as follows.

\begin{definition}
\label{definition-type-minimal}
We say the numerical type $n, m_i, a_{ij}, w_i, g_i$ of genus $g$
is {\it minimal} if there does not exist an $i$
with $g_i = 0$ and $a_{ii} = -w_i$, in other words, if there
does not exist a $(-1)$-index.
\end{definition}

\noindent
We will prove that the genus $g$ of a minimal type with $n > 1$
is greater than or equal to $\max(1, g_{top})$.

\begin{lemma}
\label{lemma-non-irreducible-minimal-type-genus-at-least-one}
If $n, m_i, a_{ij}, w_i, g_i$ is a minimal numerical type
with $n > 1$, then $g \geq 1$.
\end{lemma}

\begin{proof}
This is true because $g = 1 + \sum \Phi_i$ with
$\Phi_i = m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii})$ nonnegative
by Lemma \ref{lemma-minus-one} and the definition of minimal types.
\end{proof}

\begin{lemma}
\label{lemma-genus-nonnegative}
If $n, m_i, a_{ij}, w_i, g_i$ is a minimal numerical type
with $n > 1$, then $g \geq g_{top}$.
\end{lemma}

\begin{proof}
The reader who is only interested in the case of numerical types
associated to proper regular models can skip this proof as we will
reprove this in the geometric situation later.
We can write
$$
g_{top} = 1 - n + \frac{1}{2}\sum\nolimits_{a_{ij} > 0} 1 =
1 + \sum\nolimits_i (-1 +
\frac{1}{2}\sum\nolimits_{j \not = i,\ a_{ij} > 0} 1) 
$$
On the other hand, we have
\begin{align*}
g & =
1 + \sum m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii}) \\
& =
1 + \sum m_iw_ig_i - \sum m_iw_i +
\frac{1}{2} \sum\nolimits_{i \not = j} a_{ij}m_j \\
& =
1 + \sum\nolimits_i
m_iw_i(-1 + g_i + \frac{1}{2} \sum\nolimits_{j \not = i} \frac{a_{ij}}{w_i})
\end{align*}
The first equality is the definition, the second equality uses that
$\sum a_{ij}m_j = 0$, and the last equality uses that
uses $a_{ij} = a_{ji}$ and switching order of
summation. Comparing with the formula for $g_{top}$ we conclude
that the lemma holds if
$$
\Psi_i =
m_iw_i(-1 + g_i + \frac{1}{2} \sum\nolimits_{j \not = i} \frac{a_{ij}}{w_i})
- (-1 + \frac{1}{2}\sum\nolimits_{j \not = i,\ a_{ij} > 0} 1)
$$
is $\geq 0$ for each $i$. However, this may not be the case.
Let us analyze for which indices we can have $\Psi_i < 0$.
First, observe that
$$
(-1 + g_i + \frac{1}{2}\sum\nolimits_{j \not = i} \frac{a_{ij}}{w_i}) \geq
(-1 + \frac{1}{2}\sum\nolimits_{j \not = i,\ a_{ij} > 0} 1)
$$
because $a_{ij}/w_i$ is a nonnegative integer. Since $m_iw_i$ is
a positive integer we conclude that $\Psi_i \geq 0$ as soon as
either $m_iw_i = 1$ or the left hand side of the inequality is $\geq 0$
which happens if $g_i > 0$, or $a_{ij} > 0$ for at least two indices $j$, or
if there is a $j$ with $a_{ij} > w_i$. Thus
$$
P = \{i : \Psi_i < 0\}
$$
is the set of indices $i$ such that $m_iw_i > 1$, $g_i = 0$,
$a_{ij} > 0$ for a unique $j$, and $a_{ij} = w_i$ for this $j$.
Moreover
$$
i \in P \Rightarrow \Psi_i = \frac{1}{2}(-m_iw_i + 1)
$$
The strategy of proof is to show that given $i \in P$ we can borrow a bit
from $\Psi_j$ where $j$ is the neighbour of $i$, i.e., $a_{ij} > 0$.
However, this won't quite work because $j$ may be an index with $\Psi_j = 0$.

\medskip\noindent
Consider the set
$$
Z = \{j : g_j = 0\text{ and }
j\text{ has exactly two neighbours }i, k\text{ with }
a_{ij} = w_j = a_{jk}\}
$$
For $j \in Z$ we have $\Psi_j = 0$. We will consider sequences
$M = (i, j_1, \ldots, j_s)$ where $s \geq 0$,
$i \in P$, $j_1, \ldots, j_s \in Z$, and
$a_{ij_1} > 0, a_{j_1j_2} > 0, \ldots, a_{j_{s - 1}j_s} > 0$.
If our numerical type consists of two indices which are in $P$
or more generally if our numerical type consists of
two indices which are in $P$ and all other indices in $Z$, then
$g_{top} = 0$ and we win by
Lemma \ref{lemma-non-irreducible-minimal-type-genus-at-least-one}.
We may and do discard these cases.

\medskip\noindent
Let $M = (i, j_1, \ldots, j_s)$ be a maximal sequence and let
$k$ be the second neighbour of $j_s$. (If $s = 0$, then $k$
is the unique neighbour of $i$.) By maximality $k \not \in Z$
and by what we just said $k \not \in P$. Observe that
$w_i = a_{ij_1} = w_{j_1} = a_{j_1j_2} = \ldots = w_{j_s} =
a_{j_sk}$. Looking at the definition
of a numerical type we see that
\begin{align*}
m_ia_{ii} + m_{j_1}w_i & = 0,\\
m_iw_i + m_{j_1}a_{j_1j_1} + m_{j_2}w_i & = 0,\\
\ldots & \ldots \\
m_{j_{s - 1}}w_i + m_{j_s}a_{j_sj_s} + m_kw_i & = 0
\end{align*}
The first equality implies $m_{j_1} \geq 2m_i$ because the
numerical type is minimal. Then the second equality implies
$m_{j_2} \geq 3m_i$, and so on. In any case, we conclude that
$m_k \geq 2m_i$ (including when $s = 0$).

\medskip\noindent
Let $k$ be an index such that we have a $t > 0$ and pairwise distinct
maximal sequences $M_1, \ldots, M_t$ as above, with
$M_b = (i_b, j_{b, 1}, \ldots, j_{b, s_b})$
such that $k$ is a neighbour of $j_{b, s_b}$ for $b = 1, \ldots, t$.
We will show that $\Phi_j + \sum_{b = 1, \ldots, t} \Phi_{i_b} \geq 0$.
This will finish the proof of the lemma by what we said above.
Let $M$ be the union of the indices occurring in $M_b$, $b = 1, \ldots, t$.
We write
$$
\Psi_k =
-\sum\nolimits_{b = 1, \ldots, t} \Psi_{i_b} + \Psi_k'
$$
where
\begin{align*}
\Psi_k' & =
m_kw_k\left(-1 + g_k +
\frac{1}{2} \sum\nolimits_{b = 1, \ldots t}
(\frac{a_{kj_{b, s_b}}}{w_k} - \frac{m_{i_b}w_{i_b}}{m_kw_k}) +
\frac{1}{2} \sum\nolimits_{l \not = k,\ l \not \in M}
\frac{a_{kl}}{w_k}
\right) \\
&
-\left(
-1 + \frac{1}{2}\sum\nolimits_{l \not = k,\ l \not \in M,\ a_{kl} > 0} 1
\right)
\end{align*}
Assume $\Psi_k' < 0$ to get a contradiction.
If the set $\{l : l \not = k,\ l \not \in M,\ a_{kl} > 0\}$ is empty,
then $\{1, \ldots, n\} = M \cup \{k\}$ and $g_{top} = 0$
because $e = n - 1$ in this case and the result holds by
Lemma \ref{lemma-non-irreducible-minimal-type-genus-at-least-one}.
Thus we may assume there is at least one such $l$ which contributes
$(1/2)a_{kl}/w_k \geq 1/2$ to the sum inside the first brackets.
For each $b = 1, \ldots, t$ we have
$$
\frac{a_{kj_{b, s_b}}}{w_k} - \frac{m_{i_b}w_{i_b}}{m_kw_k} =
\frac{w_{i_b}}{w_k}(1 - \frac{m_{i_b}}{m_k})
$$
This expression is $\geq \frac{1}{2}$ because $m_k \geq 2m_{i_b}$
by the previous paragraph and is $\geq 1$ if $w_k < w_{i_b}$.
It follows that $\Psi_k' < 0$ implies $g_k = 0$.
If $t \geq 2$ or $t = 1$ and $w_k < w_{i_1}$, then $\Psi_k' \geq 0$
(here we use the existence of an $l$ as shown above) which
is a contradiction too.
Thus $t = 1$ and $w_k = w_{i_1}$. If there at least two nonzero terms
in the sum over $l$ or if there is one such $k$ and $a_{kl} > w_k$, then
$\Psi_k' \geq 0$ as well. The final possibility is that $t = 1$ and
there is one $l$ with $a_{kl} = w_k$. This is disallowed as this would
mean $k \in Z$ contradicting the maximality of $M_1$.
\end{proof}

\begin{lemma}
\label{lemma-minus-two}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
Assume $n > 1$. If $i$ is such that the contribution
$m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii})$
to the genus $g$ is $0$, then $g_i = 0$ and $a_{ii} = -2w_i$.
\end{lemma}

\begin{proof}
Follows immediately from Lemma \ref{lemma-diagonal-negative} and
$w_i > 0$, $g_i \geq 0$, and $w_i | a_{ii}$.
\end{proof}

\noindent
It turns out that the indices satisfying this relation play an
important role in the structure of minimal numerical types.
Hence we give them a name.

\begin{definition}
\label{definition-type-minus-two}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
We say $i$ is a {\it $(-2)$-index} if $g_i = 0$ and $a_{ii} = -2w_i$.
\end{definition}

\noindent
Given a minimal numerical type of genus $g$ the $(-2)$-indices
are exactly the indices which do not contribute a positive number
to the genus in the formula
$$
g = 1 + \sum m_i(w_i(g_i - 1) - \frac{1}{2} a_{ii})
$$
Thus it will be somewhat tricky to bound the quantities associated
with $(-2)$-indices as we will see later.

\begin{remark}
\label{remark-genus-equality}
Let $n, m_i, a_{ij}, w_i, g_i$ be a minimal numerical type with $n > 1$.
Equality $g = g_{top}$ can hold in Lemma \ref{lemma-genus-nonnegative}.
For example, if $m_i = w_i = 1$ and $g_i = 0$ for all $i$ and
$a_{ij} \in \{0, 1\}$ for $i < j$.
\end{remark}


\section{The Picard group of a numerical type}
\label{section-picard-group}

\noindent
Here is the definition.

\begin{definition}
\label{definition-picard-group}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$. The
{\it Picard group of $T$} is the cokernel of the matrix
$(a_{ij}/w_i)$, more precisely
$$
\Pic(T) =
\Coker\left(
\mathbf{Z}^{\oplus n} \to \mathbf{Z}^{\oplus n},\quad
e_i
\mapsto
\sum \frac{a_{ij}}{w_j}e_j
\right)
$$
where $e_i$ denotes the $i$th standard basis vector for $\mathbf{Z}^{\oplus n}$.
\end{definition}

\begin{lemma}
\label{lemma-picard-rank-1}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$.
The Picard group of $T$ is a finitely generated abelian group of rank $1$.
\end{lemma}

\begin{proof}
If $n = 1$, then $A = (a_{ij})$ is the zero matrix and
the result is clear. For $n > 1$ the matrix $A$ has rank
$n - 1$ by either Lemma \ref{lemma-recurring-real} or
Lemma \ref{lemma-recurring-symmetric-real}.
Of course the rank is not affected by scaling the rows
by $1/w_i$. This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-picard-T-and-A}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$.
Then $\Pic(T) \subset \Coker(A)$ where $A = (a_{ij})$.
\end{lemma}

\begin{proof}
Since $\Pic(T)$ is the cokernel of $(a_{ij}/w_i)$
we see that there is a commutative diagram
$$
\xymatrix{
0 \ar[r] &
\mathbf{Z}^{\oplus n} \ar[rr]_A & &
\mathbf{Z}^{\oplus n} \ar[rr] & &
\Coker(A) \ar[r] & 0 \\
0 \ar[r] &
\mathbf{Z}^{\oplus n} \ar[rr]^{(a_{ij}/w_i)} \ar[u]_{\text{id}} & &
\mathbf{Z}^{\oplus n} \ar[rr] \ar[u]_{\text{diag}(w_1, \ldots, w_n)} & &
\Pic(T) \ar[r] \ar[u] & 0
}
$$
with exact rows. By the snake lemma we conclude that
$\Pic(T) \subset \Coker(A)$.
\end{proof}

\begin{lemma}
\label{lemma-contract-picard-group}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$.
Assume $n$ is a $(-1)$-index. Let $T'$ be the numerical
type constructed in Lemma \ref{lemma-contract}. There exists an
injective map
$$
\Pic(T) \to \Pic(T')
$$
whose cokernel is an elementary abelian $2$-group.
\end{lemma}

\begin{proof}
Recall that $n' = n - 1$. Let $e_i$, resp., $e'_i$ be the $i$th
basis vector of $\mathbf{Z}^{\oplus n}$, resp.\ $\mathbf{Z}^{\oplus n - 1}$.
First we denote
$$
q : \mathbf{Z}^{\oplus n} \to \mathbf{Z}^{\oplus n - 1},
\quad e_n \mapsto 0\text{ and }e_i \mapsto e'_i\text{ for }i \leq n - 1
$$
and we set
$$
p : \mathbf{Z}^{\oplus n} \to \mathbf{Z}^{\oplus n - 1},\quad
e_n \mapsto \sum\nolimits_{j = 1}^{n - 1} \frac{a_{nj}}{w'_j} e'_j
\text{ and }
e_i \mapsto \frac{w_i}{w'_i} e'_i\text{ for }i \leq n - 1
$$
A computation (which we omit) shows there is a commutative diagram
$$
\xymatrix{
\mathbf{Z}^{\oplus n} \ar[rr]_{(a_{ij}/w_i)} \ar[d]_q & &
\mathbf{Z}^{\oplus n} \ar[d]^p \\
\mathbf{Z}^{\oplus n'} \ar[rr]^{(a'_{ij}/w'_i)} & &
\mathbf{Z}^{\oplus n'}
}
$$
Since the cokernel of the top arrow is
$\Pic(T)$ and the cokernel of the bottom arrow
is $\Pic(T')$, we obtain the desired homomorphism
of Picard groups. Since $\frac{w_i}{w'_i} \in \{1, 2\}$
we see that the cokernel of $\Pic(T) \to \Pic(T')$
is annihilated by $2$ (because $2e'_i$ is in the image of $p$
for all $i \leq n - 1$).
Finally, we show $\Pic(T) \to \Pic(T')$ is injective.
Let $L = (l_1, \ldots, l_n)$ be a representative
of an element of $\Pic(T)$ mapping to zero in $\Pic(T')$.
Since $q$ is surjective, a diagram chase shows that we can assume
$L$ is in the kernel of $p$. This means that
$l_na_{ni}/w'_i + l_iw_i/w'_i = 0$, i.e., $l_i = - a_{ni}/w_i l_n$.
Thus $L$ is the image of $-l_ne_n$ under the map $(a_{ij}/w_j)$
and the lemma is proved.
\end{proof}

\begin{lemma}
\label{lemma-picard-group-genus-nonpositive}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type $T$.
If the genus $g$ of $T$ is $\leq 0$, then $\Pic(T) = \mathbf{Z}$.
\end{lemma}

\begin{proof}
By induction on $n$. If $n = 1$, then the assertion is clear.
If $n > 1$, then $T$ is not minimal by
Lemma \ref{lemma-non-irreducible-minimal-type-genus-at-least-one}.
After replacing $T$ by an equivalent type
we may assume $n$ is a $(-1)$-index.
By Lemma \ref{lemma-contract-picard-group}
we find $\Pic(T) \subset \Pic(T')$.
By Lemma \ref{lemma-contract} we see that the genus
of $T'$ is equal to the genus of $T$ and we conclude by
induction.
\end{proof}








\section{Classification of proper subgraphs}
\label{section-classify-proper-subgraphs}

\noindent
In this section we assume given a numerical type
$n, m_i, a_{ij}, w_i, g_i$ of genus $g$. We will find
a complete list of possible ``subgraphs'' consisting entirely
of $(-2)$-indices (Definition \ref{definition-type-minus-two}) and
at the same time we classify all possible minimal numerical
types of genus $1$. In other words, in this section we prove
Proposition \ref{proposition-classify-subgraphs} and
Lemma \ref{lemma-genus-one}

\medskip\noindent
Our strategy will be as follows. Let $n, m_i, a_{ij}, w_i, g_i$
be a numerical type of genus $g$. Let $I \subset \{1, \ldots, n\}$ be a subset
consisting of $(-2)$-indices such that there does not exist a nonempty proper
subset $J \subset I$ with $a_{jj'} = 0$ for $j \in J$, $j' \in I \setminus J$.
We work by induction on the cardinality $|I|$ of $I$. If $I = \{i\}$
consists of $1$ index, then the only constraints on $m_i$, $a_{ii}$,
and $w_i$ are $w_i | a_{ii}$ from Definition \ref{definition-type}
and $a_{ii} < 0$ from Lemma \ref{lemma-diagonal-negative}
and this will serve as our base case. In the induction step
we first apply the induction hypothesis to subsets $I' \subset I$
of size $|I'| < |I|$. This will put some constraints on the possible
$m_i, a_{ij}, w_i$, $i, j \in I$. In particular, since $|I'| < |I| \leq n$
it will follow from $\sum a_{ij}m_j = 0$ and
Lemma \ref{lemma-recurring-symmetric-real} that the
sub matrices $(a_{ij})_{i, j \in I'}$ are negative definite
and their determinant will have sign $(-1)^m$.
For each possibility left over we compute the determinant of
$(a_{ij})_{i, j \in I}$. If the determinant has sign $-(-1)^{|I|}$
then this case can be discarded because Sylvester's theorem tells
us the matrix $(a_{ij})_{i, j \in I}$ is not negative semi-definite.
If the determinant has sign $(-1)^{|I|}$, then $|I| < n$ and we
(tentatively) conclude this case can occur as a possible proper subgraph
and we list it in one of the lemmas in this section.
If the determinant is $0$, then we must have $|I| = n$
(by Lemma \ref{lemma-recurring-symmetric-real} again) and $g = 0$.
In these cases we actually find all possible $m_i, a_{ij}, w_i$, $i, j \in I$
and list them in Lemma \ref{lemma-genus-one}. After completing the
argument we obtain all possible minimal numerical types of genus
$1$ with $n > 1$ because each of these necessarily consists entirely
of $(-2)$-indices (and hence will show up in the induction process)
by the formula for the genus and the remarks in the previous section.
At the very end of the day the reader can go through the list of
possibilities given in Lemma \ref{lemma-genus-one} to see that all
configurations of proper subgraphs listed in this section as possible
do in fact occur already for numerical types of genus $1$.

\medskip\noindent
Suppose that $i$ and $j$ are $(-2)$-indices with $a_{ij} > 0$.
Since the matrix $A = (a_{ij})$ is semi-negative definite by
Lemma \ref{lemma-recurring-symmetric-real} we see that the matrix
$$
\left(
\begin{matrix}
-2w_i & a_{ij} \\
a_{ij} & -2w_j
\end{matrix}
\right)
$$
is negative definite unless $n = 2$. The case $n = 2$ can happen: then
the determinant $4w_1w_2 - a_{12}^2$ is zero. Using that
$\text{lcm}(w_1, w_2)$ divides $a_{12}$ the reader easily finds
that the only possibilities are
$$
(w_1, w_2, a_{12}) = (w, w, 2w), (w, 4w, 4w), \text{ or }(4w, w, 4w)
$$
Observe that the case $(4w, w, 4w)$ is obtained from the case
$(w, 4w, 4w)$ by switching the indices $i, j$.
In these cases $g = 1$. This leads to cases
(\ref{item-two-cycle}) and (\ref{item-up4}) of Lemma \ref{lemma-genus-one}.
Assuming $n > 2$ we see
that the determinant $4w_iw_j - a_{ij}^2$ of the displayed matrix
is $> 0$ and we conclude that $a_{ij}^2/w_iw_j < 4$.
On the other hand, we know that $\text{lcm}(w_i, w_j) | a_{ij}$
and hence $a_{ij}^2/w_iw_j$ is an integer.
Thus $a_{ij}^2/w_iw_j \in \{1, 2, 3\}$ and $w_i | w_j$ or
vice versa. This leads to the following possibilities
$$
(w_1, w_2, a_{12}) = (w, w, w), (w, 2w, 2w), (w, 3w, 3w),
(2w, w, 2w), \text{ or }(3w, w, 3w)
$$
Observe that the case $(2w, w, 2w)$ is obtained from the case
$(w, 2w, 2w)$ by switching the indices $i, j$ and similarly
for the cases $(3w, w, 3w)$ and $(w, 3w, 3w)$. The first three
solutions lead to cases (\ref{item-A2}), (\ref{item-B2}), and
(\ref{item-G2}) of Lemma \ref{lemma-two-by-two}. In this lemma
we wrote out the consequences for the integers $m_i$ and $m_j$
using that $\sum_l a_{kl}m_l = 0$ for each $k$ in particular implies
$a_{ii}m_i + a_{ij}m_j \leq 0$ for $k = i$ and
$a_{ij}m_i + a_{jj}m_j \leq 0$ for $k = j$.

\begin{lemma}
\label{lemma-two-by-two}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet
}
$$
If $n > 2$, then given a pair $i, j$ of $(-2)$-indices with $a_{ij} > 0$,
then up to ordering we have the $m$'s, $a$'s, $w$'s
\begin{enumerate}
\item
\label{item-A2}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w \\
w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w
\end{matrix}
\right)
$$
with $w$ arbitrary and $2m_1 \geq m_2$ and $2m_2 \geq m_1$, or
\item
\label{item-B2}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w \\
2w & -4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w
\end{matrix}
\right)
$$
with $w$ arbitrary and $m_1 \geq m_2$ and $2m_2 \geq m_1$, or
\item
\label{item-G2}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 3w \\
3w & -6w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
3w
\end{matrix}
\right)
$$
with $w$ arbitrary and $2m_1 \geq 3m_2$ and $2m_2 \geq m_1$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $i$, $j$, and $k$ are three $(-2)$-indices with $a_{ij} > 0$
and $a_{jk} > 0$.  In other words, the index $i$ ``meets'' $j$ and
$j$ ``meets'' $k$. We will use without further mention that each pair
$(i, j)$, $(i, k)$, and $(j, k)$ is as listed in Lemma \ref{lemma-two-by-two}.
Since the matrix $A = (a_{ij})$ is semi-negative
definite by Lemma \ref{lemma-recurring-symmetric-real} we see that the matrix
$$
\left(
\begin{matrix}
-2w_i & a_{ij} & a_{ik} \\
a_{ij} & -2w_j & a_{jk} \\
a_{ik} & a_{jk} & -2w_k
\end{matrix}
\right)
$$
is negative definite unless $n = 3$. The case $n = 3$ can happen:
then the determinant\footnote{It is
$-8w_iw_jw_k + 2a_{ij}^2w_k + 2a_{jk}^2w_i + 2a_{ik}^2w_j +
2a_{ij}a_{jk}a_{ik}$.} of the matrix is zero
and we obtain the equation
$$
4 = \frac{a_{ij}^2}{w_iw_j} +
\frac{a_{jk}^2}{w_jw_k} +
\frac{a_{ik}^2}{w_iw_k} +
\frac{a_{ij}a_{ik}a_{jk}}{w_iw_jw_k}
$$
of integers. The last term on the right in this equation is determined
by the others because
$$
\left(\frac{a_{ij}a_{ik}a_{jk}}{w_iw_jw_k}\right)^2 =
\frac{a_{ij}^2}{w_iw_j} \frac{a_{jk}^2}{w_jw_k} \frac{a_{ik}^2}{w_iw_k}
$$
Since we have seen above that
$\frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k}$ are in
$\{1, 2, 3\}$ and $\frac{a_{ik}^2}{w_iw_k}$ in $\{0, 1, 2, 3\}$,
we conclude that the only possibilities are
$$
(\frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k}, \frac{a_{ik}^2}{w_iw_k}) =
(1, 1, 1), (1, 3, 0), (2, 2, 0),\text{ or } (3, 1, 0)
$$
Observe that the case $(3, 1, 0)$ is obtained from the case $(1, 3, 0)$
by reversing the order the indices $i, j, k$.
In each of these cases $g = 1$; the reader can find these as cases
(\ref{item-three-cycle}), (\ref{item-equal-up3}), (\ref{item-equal-down3}),
(\ref{item-up-up}), (\ref{item-up-down}), (\ref{item-down-up}) of
Lemma \ref{lemma-genus-one}
with one case corresponding to $(1, 1, 1)$,
two cases corresponding to $(1, 3, 0)$, and
three cases corresponding to $(2, 2, 0)$.
Assuming $n > 3$
we obtain the inequality
$$
4 > \frac{a_{ij}^2}{w_iw_j} + \frac{a_{ik}^2}{w_iw_k} +
\frac{a_{jk}^2}{w_jw_k} + \frac{a_{ij}a_{ik}a_{jk}}{w_iw_jw_k}
$$
of integers. Using the restrictions on the numbers given above
we see that the only possibilities are
$$
(\frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k}, \frac{a_{ik}^2}{w_iw_k}) =
(1, 1, 0), (1, 2, 0),\text{ or }(2, 1, 0)
$$
in particular $a_{ik} = 0$ (recall we are assuming
$a_{ij} > 0$ and $a_{jk} > 0$). Observe that the case
$(2, 1, 0)$ is obtained from the case $(1, 2, 0)$ by reversing
the ordering of the indices $i, j, k$. The first two solutions lead
to cases (\ref{item-A3}), (\ref{item-C3}), and (\ref{item-B3})
of Lemma \ref{lemma-three-by-three} where we also wrote out the consequences
for the integers $m_i$, $m_j$, and $m_k$.

\begin{lemma}
\label{lemma-three-by-three}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet
}
$$
If $n > 3$, then given a triple $i, j, k$ of $(-2)$-indices
with at least two $a_{ij}, a_{ik}, a_{jk}$ nonzero, then up
to ordering we have the $m$'s, $a$'s, $w$'s
\begin{enumerate}
\item
\label{item-A3}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 \\
w & -2w & w \\
0 & w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2$, or
\item
\label{item-C3}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 \\
w & -2w & 2w \\
0 & 2w & -4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
2w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + 2m_3$, $2m_3 \geq m_2$, or
\item
\label{item-B3}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 \\
2w & -4w & 2w \\
0 & 2w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
2w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $m_3 \geq m_2$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $i$, $j$, $k$, and $l$ are four $(-2)$-indices with
$a_{ij} > 0$, $a_{jk} > 0$, and $a_{kl} > 0$. In other words, the
index $i$ ``meets'' $j$, $j$ ``meets'' $k$, and $k$ ``meets'' $l$.
Then we see from Lemma \ref{lemma-three-by-three} that $a_{ik} = a_{jl} = 0$.
Since the matrix $A = (a_{ij})$ is semi-negative definite we see that the
matrix
$$
\left(
\begin{matrix}
-2w_i & a_{ij} & 0 & a_{il} \\
a_{ij} & -2w_j & a_{jk} & 0 \\
0 & a_{jk} & -2w_k & a_{kl} \\
a_{il} & 0 & a_{kl} & -2w_l
\end{matrix}
\right)
$$
is negative definite unless $n = 4$. The case $n = 4$ can happen:
then the determinant\footnote{It is
$16w_iw_jw_kw_l - 4a_{ij}^2w_kw_l - 4a_{jk}^2w_iw_l - 4a_{kl}^2w_iw_j -
4a_{il}^2w_jw_k + a_{ij}^2a_{kl}^2 + a_{jk}^2a_{il}^2 -
2a_{ij}a_{il}a_{jk}a_{kl}$.} of the matrix is zero and we obtain the equation
$$
16 +
\frac{a_{ij}^2}{w_iw_j}\frac{a_{kl}^2}{w_kw_l} +
\frac{a_{jk}^2}{w_jw_k}\frac{a_{il}^2}{w_iw_l} =
4\frac{a_{ij}^2}{w_iw_j} + 4\frac{a_{jk}^2}{w_jw_k} + 4\frac{a_{kl}^2}{w_kw_l}
+ 4\frac{a_{il}^2}{w_iw_l} + 2\frac{a_{ij}a_{il}a_{jk}a_{kl}}{w_iw_jw_kw_l}
$$
of nonnegative integers. The last term on the right in this equation is
determined by the others because
$$
\left(\frac{a_{ij}a_{il}a_{jk}a_{kl}}{w_iw_jw_kw_l}\right)^2 =
\frac{a_{ij}^2}{w_iw_j} \frac{a_{jk}^2}{w_jw_k}
\frac{a_{kl}^2}{w_kw_l} \frac{a_{il}^2}{w_iw_l}
$$
Since we have seen above that
$\frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k}, \frac{a_{kl}^2}{w_kw_l}$
are in $\{1, 2\}$ and $\frac{a_{il}^2}{w_iw_l}$ in $\{0, 1, 2\}$,
we conclude that the only possible solutions are
$$
(\frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k}, \frac{a_{kl}^2}{w_kw_l},
\frac{a_{il}^2}{w_iw_l}) =
(1, 1, 1, 1) \text{ or } (2, 1, 2, 0)
$$
and case $g = 1$; the reader can find these as cases
(\ref{item-four-cycle}), (\ref{item-up-equal-up}),
(\ref{item-up-equal-down}), and (\ref{item-down-equal-up})
of Lemma \ref{lemma-genus-one}. Assuming $n > 4$
we obtain the inequality
$$
16 +
\frac{a_{ij}^2}{w_iw_j}\frac{a_{kl}^2}{w_kw_l} +
\frac{a_{jk}^2}{w_jw_k}\frac{a_{il}^2}{w_iw_l} >
4\frac{a_{ij}^2}{w_iw_j} + 4\frac{a_{jk}^2}{w_jw_k} + 4\frac{a_{kl}^2}{w_kw_l}
+ 4\frac{a_{il}^2}{w_iw_l} + 2\frac{a_{ij}a_{il}a_{jk}a_{kl}}{w_iw_jw_kw_l}
$$
of nonnegative integers. Using the restrictions on the numbers given above
we see that the only possibilities are
$$
(\frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k}, \frac{a_{kl}^2}{w_kw_l},
\frac{a_{il}^2}{w_iw_l}) =
(1, 1, 1, 0), (1, 1, 2, 0), (1, 2, 1, 0), \text{ or }(2, 1, 1, 0)
$$
in particular $a_{il} = 0$ (recall that we assumed the other three
to be nonzero). Observe that the case $(2, 1, 1, 0)$ is obtained
from the case $(1, 1, 2, 0)$ by reversing the ordering
of the indices $i, j, k, l$. The first three solutions lead
to cases (\ref{item-A4}), (\ref{item-C4}), (\ref{item-B4}), and
(\ref{item-F4}) of Lemma \ref{lemma-four-by-four}
where we also wrote out the consequences for the integers $m_i$, $m_j$, $m_k$,
and $m_l$.

\begin{lemma}
\label{lemma-four-by-four}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet
}
$$
If $n > 4$, then given four $(-2)$-indices $i, j, k, l$
with $a_{ij}, a_{jk}, a_{kl}$ nonzero, then up
to ordering we have the $m$'s, $a$'s, $w$'s
\begin{enumerate}
\item
\label{item-A4}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 \\
w & -2w & w & 0 \\
0 & w & -2w & w \\
0 & 0 & w & -2w 
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4$,
and $2m_4 \geq m_3$, or
\item
\label{item-C4}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 \\
w & -2w & w & 0 \\
0 & w & -2w & 2w \\
0 & 0 & 2w & -4w 
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
2w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + 2m_4$,
and $2m_4 \geq m_3$, or
\item
\label{item-B4}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 & 0 \\
2w & -4w & 2w & 0 \\
0 & 2w & -4w & 2w \\
0 & 0 & 2w & -2w 
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
2w \\
2w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4$,
and $m_4 \geq m_3$, or
\item
\label{item-F4}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 \\
w & -2w & 2w & 0 \\
0 & 2w & -4w & 2w \\
0 & 0 & 2w & -4w 
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
2w \\
2w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + 2m_3$, $2m_3 \geq m_2 + m_4$,
and $2m_4 \geq m_3$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $i$, $j$, $k$,
and $l$ are four $(-2)$-indices with $a_{ij} > 0$, $a_{ij} > 0$, and
$a_{il} > 0$. In other words, the index $i$ ``meets'' the indices
$j$, $k$, $l$. Then we see from Lemma \ref{lemma-three-by-three} that
$a_{jk} = a_{jl} = a_{kl} = 0$. Since the matrix $A = (a_{ij})$ is
semi-negative definite we see that the matrix
$$
\left(
\begin{matrix}
-2w_i & a_{ij} & a_{ik} & a_{il} \\
a_{ij} & -2w_j & 0 & 0 \\
a_{ik} & 0 & -2w_k & 0 \\
a_{il} & 0 & 0 & -2w_l
\end{matrix}
\right)
$$
is negative definite unless $n = 4$. The case $n = 4$ can happen:
then the determinant\footnote{It is
$16w_iw_jw_kw_l - 4a_{ij}^2w_kw_l - 4a_{ik}^2w_jw_l - 4a_{il}^2w_jw_k$.}
of the matrix is zero and we obtain the equation
$$
4 = \frac{a_{ij}^2}{w_iw_j} + \frac{a_{ik}^2}{w_iw_k} + \frac{a_{il}^2}{w_jw_l}
$$
of nonnegative integers. Since we have seen above that
$\frac{a_{ij}^2}{w_iw_j}, \frac{a_{ik}^2}{w_iw_k}, \frac{a_{il}^2}{w_iw_l}$
are in $\{1, 2\}$, we conclude that the only possibilities
are up to reordering: $4 = 1 + 1 + 2$. In each of these
cases $g = 1$; the reader can find these as cases
(\ref{item-triple-with-up}) and (\ref{item-triple-with-down}) of
Lemma \ref{lemma-genus-one}. Assuming $n > 4$
we obtain the inequality
$$
4 > \frac{a_{ij}^2}{w_iw_j} + \frac{a_{ik}^2}{w_iw_k} + \frac{a_{il}^2}{w_jw_l}
$$
of nonnegative integers. This implies that $\frac{a_{ij}^2}{w_iw_j} =
\frac{a_{ik}^2}{w_iw_k} = \frac{a_{il}^2}{w_jw_l} = 1$
and that $w_i = w_j = w_k = w_l$. This leads to case
(\ref{item-D4}) of Lemma \ref{lemma-D4}
where we also wrote out the consequences for the integers $m_i$, $m_j$, $m_k$,
and $m_l$.

\begin{lemma}
\label{lemma-D4}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] & \bullet \\
& \bullet
}
$$
If $n > 4$, then given four $(-2)$-indices $i, j, k, l$
with $a_{ij}, a_{ik}, a_{il}$ nonzero, then up
to ordering we have the $m$'s, $a$'s, $w$'s
\begin{enumerate}
\item
\label{item-D4}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & w & w \\
w & -2w & 0 & 0 \\
w & 0 & -2w & 0 \\
w & 0 & 0 & -2w 
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2 + m_3 + m_4$, $2m_2 \geq m_1$, $2m_3 \geq m_1$,
$2m_4 \geq m_1$. Observe that this implies $m_1 \geq \max(m_2, m_3, m_4)$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $h$, $i$, $j$, $k$, and $l$ are five $(-2)$-indices
with $a_{hi} > 0$, $a_{ij} > 0$, $a_{jk} > 0$, and $a_{kl} > 0$.
In other words, the index $h$ ``meets'' $i$, $i$ ``meets'' $j$,
$j$ ``meets'' $k$, and $k$ ``meets'' $l$.
Then we can apply Lemmas \ref{lemma-three-by-three} and
\ref{lemma-four-by-four} to see that
$a_{hj} = a_{hk} = a_{ik} = a_{il} = a_{jl} = 0$
and that the fractions
$\frac{a_{hi}^2}{w_hw_i}, \frac{a_{ij}^2}{w_iw_j}, \frac{a_{jk}^2}{w_jw_k},
\frac{a_{kl}^2}{w_kw_l}$ are in $\{1, 2\}$ and the fraction
$\frac{a_{hl}^2}{w_hw_l} \in \{0, 1, 2\}$.
Since the matrix $A = (a_{ij})$ is semi-negative definite we see that the
matrix
$$
\left(
\begin{matrix}
-2w_h & a_{hi} & 0 & 0 & a_{hl} \\
a_{hi} & -2w_i & a_{ij} & 0 & 0 \\
0 & a_{ij} & -2w_j & a_{jk} & 0 \\
0 & 0 & a_{jk} & -2w_k & a_{kl} \\
a_{hl} & 0 & 0 & a_{kl} & -2w_l
\end{matrix}
\right)
$$
is negative definite unless $n = 5$. The case $n = 5$ can happen:
then the determinant\footnote{It is
$-32w_hw_iw_jw_kw_l +
8a_{hi}^2w_jw_kw_l +
8a_{ij}^2w_hw_kw_l +
8a_{jk}^2w_hw_iw_l +
8a_{kl}^2w_hw_iw_j +
8a_{hl}^2w_iw_jw_k -
2a_{hi}^2a_{jk}^2w_l -
2a_{hi}^2a_{kl}^2w_j -
2a_{ij}^2a_{kl}^2w_h -
2a_{hl}^2a_{ij}^2w_k -
2a_{hl}^2a_{jk}^2w_i +
2a_{hi}a_{ij}a_{jk}a_{kl}a_{hl}
$
.}
of the matrix is zero and we obtain the equation
\begin{align*}
16 + 
\frac{a_{hi}^2}{w_hw_i}\frac{a_{jk}^2}{w_jw_k} +
\frac{a_{hi}^2}{w_hw_i}\frac{a_{kl}^2}{w_kw_l} +
\frac{a_{ij}^2}{w_iw_j}\frac{a_{kl}^2}{w_kw_l} +
\frac{a_{hl}^2}{w_hw_l}\frac{a_{ij}^2}{w_iw_j} +
\frac{a_{hl}^2}{w_hw_l}\frac{a_{jk}^2}{w_jw_k} \\
= 4\frac{a_{hi}^2}{w_hw_i} +
4\frac{a_{ij}^2}{w_iw_j} +
4\frac{a_{jk}^2}{w_jw_k} +
4\frac{a_{kl}^2}{w_kw_l} +
4\frac{a_{hl}^2}{w_hw_l} +
\frac{a_{hi}a_{ij}a_{jk}a_{kl}a_{hl}}{w_hw_iw_jw_kw_l}
\end{align*}
of nonnegative integers. The last term on the right in this equation is
determined by the others because
$$
\left(\frac{a_{hi}a_{ij}a_{jk}a_{kl}a_{hl}}{w_hw_iw_jw_kw_l} \right)^2 =
\frac{a_{hi}^2}{w_hw_i} \frac{a_{ij}^2}{w_iw_j}
\frac{a_{jk}^2}{w_jw_k} \frac{a_{kl}^2}{w_kw_l} \frac{a_{hl}^2}{w_hw_l}
$$
We conclude the only possible solutions are
$$
(\frac{a_{hi}^2}{w_hw_i}, \frac{a_{ij}^2}{w_iw_j},
\frac{a_{jk}^2}{w_jw_k}, \frac{a_{kl}^2}{w_kw_l}, \frac{a_{hl}^2}{w_hw_l}) =
(1, 1, 1, 1, 1), (1, 1, 2, 1, 0), (1, 2, 1, 1, 0), \text{ or }(2, 1, 1, 2, 0)
$$
Observe that the case $(1, 2, 1, 1, 0)$ is obtained from the case
$(1, 1, 2, 1, 0)$ by reversing the order of the indices $h, i, j, k, l$.
In these cases $g = 1$; the reader can find these as cases
(\ref{item-five-cycle}),
(\ref{item-equal-equal-up-equal}), (\ref{item-equal-equal-down-equal}),
(\ref{item-up-equal-equal-up}), (\ref{item-up-equal-equal-down}), and
(\ref{item-down-equal-equal-up}) of Lemma \ref{lemma-genus-one}
with one case corresponding to $(1, 1, 1, 1, 1)$,
two cases corresponding to $(1, 1, 2, 1, 0)$, and
three cases corresponding to $(2, 1, 1, 2, 0)$.
Assuming $n > 5$ we obtain the inequality
\begin{align*}
16 + 
\frac{a_{hi}^2}{w_hw_i}\frac{a_{jk}^2}{w_jw_k} +
\frac{a_{hi}^2}{w_hw_i}\frac{a_{kl}^2}{w_kw_l} +
\frac{a_{ij}^2}{w_iw_j}\frac{a_{kl}^2}{w_kw_l} +
\frac{a_{hl}^2}{w_hw_l}\frac{a_{ij}^2}{w_iw_j} +
\frac{a_{hl}^2}{w_hw_l}\frac{a_{jk}^2}{w_jw_k} \\
> 4\frac{a_{hi}^2}{w_hw_i} +
4\frac{a_{ij}^2}{w_iw_j} +
4\frac{a_{jk}^2}{w_jw_k} +
4\frac{a_{kl}^2}{w_kw_l} +
4\frac{a_{hl}^2}{w_hw_l} +
\frac{a_{hi}a_{ij}a_{jk}a_{kl}a_{hl}}{w_hw_iw_jw_kw_l}
\end{align*}
of nonnegative integers.  Using the restrictions on the numbers given above
we see that the only possibilities are
$$
(\frac{a_{hi}^2}{w_hw_i}, \frac{a_{ij}^2}{w_iw_j},
\frac{a_{jk}^2}{w_jw_k}, \frac{a_{kl}^2}{w_kw_l}, \frac{a_{hl}^2}{w_hw_l}) =
(1, 1, 1, 1, 0), (1, 1, 1, 2, 0), \text{ or } (2, 1, 1, 1, 0)
$$
in particular $a_{hl} = 0$ (recall that we assumed the other four
to be nonzero). Observe that the case $(1, 1, 1, 2, 0)$
is obtained from the case $(2, 1, 1, 1, 0)$ by reversing the order
of the indices $h, i, j, k, l$. The first two solutions lead to
cases (\ref{item-A5}), (\ref{item-C5}), and (\ref{item-B5}) of
Lemma \ref{lemma-five-by-five} where we also wrote out the
consequences for the integers $m_h$, $m_i$, $m_j$, $m_k$, and $m_l$.

\begin{lemma}
\label{lemma-five-by-five}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet
}
$$
If $n > 5$, then given five $(-2)$-indices $h, i, j, k, l$
with $a_{hi}, a_{ij}, a_{jk}, a_{kl}$ nonzero, then up
to ordering we have the $m$'s, $a$'s, $w$'s
\begin{enumerate}
\item
\label{item-A5}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 \\
0 & w & -2w & w & 0 \\
0 & 0 & w & -2w & w \\
0 & 0 & 0 & w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4$,
$2m_4 \geq m_3 + m_5$, and $2m_5 \geq m_4$, or
\item
\label{item-C5}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 \\
0 & w & -2w & w & 0 \\
0 & 0 & w & -2w & 2w \\
0 & 0 & 0 & 2w & -4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
2w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + 2m_4$,
$2m_4 \geq m_3 + m_5$, and $2m_5 \geq m_4$, or
\item
\label{item-B5}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 & 0 & 0 \\
2w & -4w & 2w & 0 & 0 \\
0 & 2w & -4w & 2w & 0 \\
0 & 0 & 2w & -4w & 2w \\
0 & 0 & 0 & 2w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
2w \\
2w \\
2w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4$,
$2m_4 \geq m_3 + m_5$, and $m_4 \geq m_3$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $h$, $i$, $j$, $k$, and $l$ are five $(-2)$-indices
with $a_{hi} > 0$, $a_{hj} > 0$, $a_{hk} > 0$, and $a_{hl} > 0$.
In other words, the index $h$ ``meets'' the indices
$i$, $j$, $k$, $l$. Then we see from Lemma \ref{lemma-three-by-three}
that $a_{ij} = a_{ik} = a_{il} = a_{jk} = a_{jl} = a_{kl} = 0$ and
by Lemma \ref{lemma-D4} that
$w_h = w_i = w_j = w_k = w_l = w$ for some integer $w > 0$ and
$a_{hi} = a_{hj} = a_{hk} = a_{hl} = -2w$.
The corresponding matrix
$$
\left(
\begin{matrix}
-2w & w & w & w & w \\
w & -2w & 0 & 0 & 0 \\
w & 0 & -2w & 0 & 0 \\
w & 0 & 0 & -2w & 0 \\
w & 0 & 0 & 0 & -2w
\end{matrix}
\right)
$$
is singular. Hence this can only happen if $n = 5$ and $g = 1$.
The reader can find this as case
(\ref{item-quadruple}) Lemma \ref{lemma-genus-one}.

\begin{lemma}
\label{lemma-fourfold}
Nonexistence of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[ld] \ar@{-}[r] \ar@{-}[d] & \bullet \\
\bullet & \bullet
}
$$
If $n > 5$, there do {\bf not} exist five $(-2)$-indices
$h$, $i$, $j$, $k$ with $a_{hi} > 0$, $a_{hj} > 0$, $a_{hk} > 0$, and
$a_{hl} > 0$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $h$, $i$, $j$, $k$, and $l$ are five $(-2)$-indices
with $a_{hi} > 0$, $a_{ij} > 0$, $a_{jk} > 0$, and $a_{jl} > 0$.
In other words, the index $h$ ``meets'' $i$ and the index $j$ ``meets''
the indices $i$, $k$, $l$. Then we see from
Lemma \ref{lemma-D4} that $a_{ik} = a_{il} = a_{kl} = 0$,
$w_i = w_j = w_k = w_l = w$, and $a_{ij} = a_{jk} = a_{jl} = w$
for some integer $w$. Applying Lemma \ref{lemma-four-by-four} to
the four tuples
$h, i, j, k$ and $h, i, j, l$ we see that $a_{hj} = a_{hk} = a_{hl} = 0$,
that $w_h = \frac{1}{2}w$, $w$, or $2w$, and that
correspondingly $a_{hi} = w$, $w$, or $2w$.
Since $A$ is semi-negative definite we see that the matrix
$$
\left(
\begin{matrix}
-2w_h & a_{hi} & 0 & 0 & 0 \\
a_{hi} & -2w & w & 0 & 0 \\
0 & w & -2w & w & w \\
0 & 0 & w & -2w & 0 \\
0 & 0 & w & 0 & -2w
\end{matrix}
\right)
$$
is negative definite unless $n = 5$. The reader computes that the
determinant of the matrix is $0$ when $w_h = \frac{1}{2}w$ or $2w$.
This leads to cases (\ref{item-triple-extended-up}) and
(\ref{item-triple-extended-down}) of Lemma \ref{lemma-genus-one}.
For $w_h = w$ we obtain case (\ref{item-D5}) of
Lemma \ref{lemma-D5}.

\begin{lemma}
\label{lemma-D5}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] \ar@{-}[d] & \bullet \\
& & \bullet
}
$$
If $n > 5$, then given five $(-2)$-indices $h, i, j, k, l$
with $a_{hi}, a_{ij}, a_{jk}, a_{jl}$ nonzero, then up
to ordering we have the $m$'s, $a$'s, $w$'s
\begin{enumerate}
\item
\label{item-D5}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 \\
0 & w & -2w & w & w \\
0 & 0 & w & -2w & 0 \\
0 & 0 & w & 0 & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4 + m_5$,
$2m_4 \geq m_3$, and $2m_5 \geq m_3$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $t > 5$ and $i_1, \ldots, i_t$ are $t$ distinct $(-2)$-indices
such that $a_{i_ji_{j + 1}}$ is nonzero for $j = 1, \ldots, t - 1$. We will
prove by induction on $t$ that if $n = t$ this leads to possibilities
(\ref{item-n-cycle}), (\ref{item-up-chain-equal-up}),
(\ref{item-up-chain-equal-down}), (\ref{item-down-chain-equal-up})
of Lemma \ref{lemma-genus-one} and if $n > t$ to cases
(\ref{item-An}), (\ref{item-Cn}), and (\ref{item-Bn}) of
Lemma \ref{lemma-long}.
First, if $a_{i_1i_t}$ is nonzero, then it is clear from
the result of Lemma \ref{lemma-five-by-five} that
$w_{i_1} = \ldots = w_{i_t} = w$ and that
$a_{i_ji_{j + 1}} = w$ for $j = 1, \ldots, t - 1$ and
$a_{i_1i_t} = w$. Then the vector $(1, \ldots, 1)$ is in the kernel
of the corresponding $t \times t$ matrix. Thus we must have $n = t$
and we see that the genus is $1$ and that we are
in case (\ref{item-n-cycle}) of Lemma \ref{lemma-genus-one}.
Thus we may assume $a_{i_1i_t} = 0$.
By induction hypothesis (or Lemma \ref{lemma-five-by-five} if $t = 6$)
we see that $a_{i_ji_k} = 0$ if $k > j + 1$.
Moreover, we have $w_{i_1} = \ldots = w_{i_{t - 1}} = w$
for some integer $w$ and $w_{i_1}, w_{i_t} \in \{\frac{1}{2}w, w, 2w\}$.
Moreover, the value of $w_{i_1}$, resp.\ $w_{i_t}$ being
$\frac{1}{2}w$, $w$, or $2w$ implies that the
value of $a_{i_1i_2}$, resp.\ $a_{i_{t - 1}i_t}$
is $w$, $w$, or $2w$. This gives $9$ possibilities.
In each case it is easy to decide what happens:
\begin{enumerate}
\item if $(w_{i_1}, w_{i_t}) = (\frac{1}{2}w, \frac{1}{2}w)$, then
we are in case (\ref{item-up-chain-equal-down}) of
Lemma \ref{lemma-genus-one},
\item if $(w_{i_1}, w_{i_t}) = (\frac{1}{2}w, w)$ or $(w, \frac{1}{2}w)$
then we are in case (\ref{item-Bn}) of Lemma \ref{lemma-long},
\item if $(w_{i_1}, w_{i_t}) = (\frac{1}{2}w, 2w)$ or $(2w, \frac{1}{2}w)$
then we are in case (\ref{item-up-chain-equal-up}) of
Lemma \ref{lemma-genus-one},
\item if $(w_{i_1}, w_{i_t}) = (w, w)$ then we are in case
(\ref{item-An}) of Lemma \ref{lemma-long},
\item if $(w_{i_1}, w_{i_t}) = (w, 2w)$ or $(2w, w)$ then we are
in case (\ref{item-Cn}) of Lemma \ref{lemma-long}, and
\item if $(w_{i_1}, w_{i_t}) = (2w, 2w)$ then we are in case
(\ref{item-down-chain-equal-up}) of Lemma \ref{lemma-genus-one}.
\end{enumerate}

\begin{lemma}
\label{lemma-long}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{..}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet
}
$$
Let $t > 5$ and $n > t$. Then given $t$ distinct $(-2)$-indices
$i_1, \ldots, i_t$ such that $a_{i_ji_{j + 1}}$ is nonzero for
$j = 1, \ldots, t - 1$, then up to reversing the order of these indices
we have the $a$'s and $w$'s
\begin{enumerate}
\item
\label{item-An}
are given by $w_{i_1} = w_{i_2} = \ldots = w_{i_t} = w$,
$a_{i_ji_{j + 1}} = w$, and $a_{i_ji_k} = 0$ if $k > j + 1$, or
\item
\label{item-Cn}
are given by $w_{i_1} = w_{i_2} = \ldots = w_{i_{t - 1}} = w$,
$w_{j_t} = 2w$, $a_{i_ji_{j + 1}} = w$ for $j < t - 1$,
$a_{i_{t - 1}i_t} = 2w$, and $a_{i_ji_k} = 0$ if $k > j + 1$, or
\item
\label{item-Bn}
are given by $w_{i_1} = w_{i_2} = \ldots = w_{i_{t - 1}} = 2w$,
$w_{j_t} = w$, $a_{i_ji_{j + 1}} = 2w$, and
$a_{i_{t - 1}i_t} = 2w$, and $a_{i_ji_k} = 0$ if $k > j + 1$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $t > 4$ and $i_1, \ldots, i_{t + 1}$ are $t + 1$
distinct $(-2)$-indices such that $a_{i_ji_{j + 1}} > 0$
for $j = 1, \ldots, t - 1$ and such that $a_{j_{t - 1}j_{t + 1}} > 0$.
See picture in Lemma \ref{lemma-Dn}. We will prove by induction on $t$
that if $n = t + 1$ this leads to possibilities
(\ref{item-Dn-extended-up}) and (\ref{item-Dn-extended-down})
of Lemma \ref{lemma-genus-one} and if $n > t + 1$ to
case (\ref{item-Dn}) of Lemma \ref{lemma-Dn}.
By induction hypothesis (or Lemma \ref{lemma-D5} in case $t = 5$)
we see that $a_{i_ji_k}$ is zero outside of the required
nonvanishing ones for $j, k \geq 2$.
Moreover, we see that $w_2 = \ldots = w_{t + 1} = w$ for some integer
$w$ and that the nonvanishing $a_{i_ji_k}$ for $j, k \geq 2$ are
equal to $w$. Applying Lemma \ref{lemma-long}
(or Lemma \ref{lemma-five-by-five} if $t = 5$) to the sequence
$i_1, \ldots, i_t$ and to the sequence
$i_1, \ldots, i_{t - 1}, i_{t + 1}$ we conclude that
$a_{i_1 i_j} = 0$ for $j \geq 3$ and that
$w_1$ is equal to $\frac{1}{2}w$, $w$, or $2w$
and that correspondingly $a_{i_1i_2}$ is $w, w, 2w$.
This gives $3$ possibilities. In each case it is easy to
decide what happens:
\begin{enumerate}
\item If $w_1 = \frac{1}{2}w$, then we are in case
(\ref{item-Dn-extended-down}) of Lemma \ref{lemma-genus-one}.
\item If $w_1 = w$, then we are in case
(\ref{item-Dn}) of Lemma \ref{lemma-Dn}.
\item If $w_1 = 2w$, then we are in case
(\ref{item-Dn-extended-up}) of Lemma \ref{lemma-genus-one}.
\end{enumerate}

\begin{lemma}
\label{lemma-Dn}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{..}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] \ar@{-}[d] & \bullet \\
& & & \bullet
}
$$
Let $t > 4$ and $n > t + 1$. Then given $t + 1$ distinct
$(-2)$-indices $i_1, \ldots, i_{t + 1}$ such that $a_{i_ji_{j + 1}}$
is nonzero for $j = 1, \ldots, t - 1$ and $a_{i_{t - 1}i_{t + 1}}$
is nonzero, then we have the $a$'s and $w$'s
\begin{enumerate}
\item
\label{item-Dn}
are given by $w_{i_1} = w_{i_2} = \ldots = w_{i_{t + 1}} = w$,
$a_{i_ji_{j + 1}} = w$ for $j = 1, \ldots, t - 1$,
$a_{i_{t - 1}i_{t + 1}} = w$ and $a_{i_ji_k} = 0$ for other
pairs $(j, k)$ with $j > k$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose we are given $6$ distinct $(-2)$-indices $g, h, i, j, k, l$
such that $a_{gh}, a_{hi}, a_{ij}, a_{jk}, a_{il}$ are nonzero.
See picture in Lemma \ref{lemma-E6}. Then we can apply
Lemma \ref{lemma-D5} to see that we must be in the situation
of Lemma \ref{lemma-E6}. Since the determinant is $3w^6 > 0$
we conclude that in this case it never happens that $n = 6$!

\begin{lemma}
\label{lemma-E6}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \\
& & \bullet
}
$$
Let $n > 6$. Then given $6$ distinct $(-2)$-indices $i_1, \ldots, i_6$
such that $a_{12}, a_{23}, a_{34}, a_{45}, a_{36}$ are nonzero, then
we have the $m$'s, $a$'s, and $w$'s
\begin{enumerate}
\item
\label{item-E6}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5 \\
m_6
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 \\
0 & w & -2w & w & 0 & w \\
0 & 0 & w & -2w & w & 0 \\
0 & 0 & 0 & w & -2w & 0 \\
0 & 0 & w & 0 & 0 & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4 + m_6$,
$2m_4 \geq m_3 + m_5$, $2m_5 \geq m_3$, and $2m_6 \geq m_3$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose that $t \geq 4$ and $i_0, \ldots, i_{t + 1}$ are
$t + 2$ distinct $(-2)$-indices such that
$a_{i_ji_{j + 1}} > 0$ for $j = 1, \ldots, t - 1$
and $a_{i_0i_2} > 0$ and $a_{i_{t - 1}i_{t + 1}} > 0$.
See picture in Lemma \ref{lemma-double-triple}.
Then we can apply Lemmas \ref{lemma-D5} and \ref{lemma-Dn}
to see that all other $a_{i_ji_k}$ for $j < k$ are zero
and that $w_{i_0} = \ldots = w_{i_{t + 1}} = w$ for some
integer $w$ and that the required nonzero off diagonal
entries of $A$ are equal to $w$.
A computation shows that the determinant of the
corresponding matrix is zero. Hence $n = t + 2$
and we are in case (\ref{item-double-triple}) of
Lemma \ref{lemma-genus-one}.

\begin{lemma}
\label{lemma-double-triple}
Nonexistence of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{..}[r] \ar@{-}[d] &
\bullet \ar@{-}[d] \ar@{-}[r] & \bullet \\
& \bullet & \bullet
}
$$
Assume $t \geq 4$ and $n > t + 2$.
There do {\bf not} exist $t + 2$ distinct
$(-2)$-indices $i_0, \ldots, i_{t + 1}$ such that
$a_{i_ji_{j + 1}} > 0$ for $j = 1, \ldots, t - 1$
and $a_{i_0i_2} > 0$ and $a_{i_{t - 1}i_{t + 1}} > 0$.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose we are given $7$ distinct $(-2)$-indices $f, g, h, i, j, k, l$
such that the numbers
$a_{fg}, a_{gh}, a_{ij}, a_{jh}, a_{kl}, a_{lh}$ are nonzero.
See picture in Lemma \ref{lemma-E6-completed}. Then we can apply
Lemma \ref{lemma-D5} to see that the corresponding matrix is
$$
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 & 0 \\
0 & w & -2w & 0 & w & 0 & w \\
0 & 0 & 0 & -2w & w & 0 & 0 \\
0 & 0 & w & w & -2w & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & -2w & w \\
0 & 0 & w & 0 & 0 & w & -2w
\end{matrix}
\right)
$$
Since the determinant is $0$ we conclude that we must have $n = 7$
and $g = 1$ and we get case (\ref{item-E6-completed})
of Lemma \ref{lemma-genus-one}.

\begin{lemma}
\label{lemma-E6-completed}
Nonexistence of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \\
& & \bullet \ar@{-}[d] \\
& & \bullet
}
$$
Assume $n > 7$. There do {\bf not} exist $7$ distinct
$(-2)$-indices $f, g, h, i, j, k, l$
such that $a_{fg}, a_{gh}, a_{ij}, a_{jh}, a_{kl}, a_{lh}$ are nonzero.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose we are given $7$ distinct $(-2)$-indices $f, g, h, i, j, k, l$
such that the numbers
$a_{fg}, a_{gh}, a_{hi}, a_{ij}, a_{jk}, a_{il}$ are nonzero.
See picture in Lemma \ref{lemma-E7}. Then we can apply
Lemmas \ref{lemma-D5} and \ref{lemma-Dn}
to see that we must be in the situation
of Lemma \ref{lemma-E7}. Since the determinant is $-8w^7 > 0$
we conclude that in this case it never happens that $n = 7$!

\begin{lemma}
\label{lemma-E7}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] \ar@{-}[d] & \bullet \ar@{-}[r] & \bullet \\
& & & \bullet
}
$$
Let $n > 7$. Then given $7$ distinct $(-2)$-indices $i_1, \ldots, i_7$
such that $a_{12}, a_{23}, a_{34}, a_{45}, a_{56}, a_{47}$ are nonzero,
then we have the $m$'s, $a$'s, and $w$'s
\begin{enumerate}
\item
\label{item-E7}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5 \\
m_6 \\
m_7
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 & 0 \\
0 & w & -2w & w & 0 & 0 & 0 \\
0 & 0 & w & -2w & w & 0 & w \\
0 & 0 & 0 & w & -2w & w & 0 \\
0 & 0 & 0 & 0 & w & -2w & 0 \\
0 & 0 & 0 & w & 0 & 0 & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4$,
$2m_4 \geq m_3 + m_5 + m_7$, $2m_5 \geq m_4 + m_6$, $2m_6 \geq m_5$,
and $2m_7 \geq m_4$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose we are given $8$ distinct $(-2)$-indices whose pattern
of nonzero entries $a_{ij}$ of the matrix $A$ looks like
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \\
& & & & \bullet
}
$$
or like
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] \ar@{-}[d] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \\
& & & \bullet
}
$$
Arguing exactly as in the proof of Lemma \ref{lemma-E7}
we see that the first pattern leads to case
(\ref{item-E8}) in Lemma \ref{lemma-E8}
and does not lead to a new case in Lemma \ref{lemma-genus-one}.
Arguing exactly as in the proof of Lemma \ref{lemma-E6-completed}
we see that the second pattern does not occur if
$n > 8$, but leads to case (\ref{item-E7-completed})
in Lemma \ref{lemma-genus-one} when $n = 8$.

\begin{lemma}
\label{lemma-E8}
Classification of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \\
& & & & \bullet
}
$$
Let $n > 8$. Then given $8$ distinct $(-2)$-indices $i_1, \ldots, i_8$
such that $a_{12}, a_{23}, a_{34}, a_{45}, a_{56}, a_{65}, a_{57}$
are nonzero, then we have the $m$'s, $a$'s, and $w$'s
\begin{enumerate}
\item
\label{item-E8}
are given by
$$
\left(
\begin{matrix}
m_1 \\
m_2 \\
m_3 \\
m_4 \\
m_5 \\
m_6 \\
m_7 \\
m_8
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 & 0 & 0 \\
0 & w & -2w & w & 0 & 0 & 0 & 0 \\
0 & 0 & w & -2w & w & 0 & 0 & 0 \\
0 & 0 & 0 & w & -2w & w & 0 & w \\
0 & 0 & 0 & 0 & w & -2w & w & 0 \\
0 & 0 & 0 & 0 & 0 & w & -2w & 0 \\
0 & 0 & 0 & 0 & w & 0 & 0 & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w \\
w \\
w \\
w
\end{matrix}
\right)
$$
with $2m_1 \geq m_2$, $2m_2 \geq m_1 + m_3$, $2m_3 \geq m_2 + m_4$,
$2m_4 \geq m_3 + m_5$, $2m_5 \geq m_4 + m_6 + m_8$, $2m_6 \geq m_5 + m_7$,
$2m_7 \geq m_6$, and $2m_8 \geq m_5$.
\end{enumerate}
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\begin{lemma}
\label{lemma-E7-completed}
Nonexistence of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] & \bullet \\
& & & \bullet
}
$$
Assume $n > 8$. There do {\bf not} exist $8$ distinct
$(-2)$-indices $e, f, g, h, i, j, k, l$
such that $a_{ef}, a_{fg}, a_{gh}, a_{hi}, a_{ij}, a_{jk}, a_{lh}$
are nonzero.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Suppose we are given $9$ distinct $(-2)$-indices whose pattern
of nonzero entries $a_{ij}$ of the matrix $A$ looks like
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \\
& & & & & \bullet
}
$$
Arguing exactly as in the proof of Lemma \ref{lemma-E6-completed}
we see that this pattern does not occur if
$n > 9$, but leads to case (\ref{item-E8-completed})
in Lemma \ref{lemma-genus-one} when $n = 9$.

\begin{lemma}
\label{lemma-E8-completed}
Nonexistence of proper subgraphs of the form
$$
\xymatrix{
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] &
\bullet \ar@{-}[r] & \bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \ar@{-}[r] & \bullet \\
& & & & & \bullet
}
$$
Assume $n > 9$. There do {\bf not} exist $9$ distinct
$(-2)$-indices $d, e, f, g, h, i, j, k, l$
such that $a_{de}, a_{ef}, a_{fg}, a_{gh}, a_{hi}, a_{ij}, a_{jk}, a_{lh}$
are nonzero.
\end{lemma}

\begin{proof}
See discussion above.
\end{proof}

\noindent
Collecting all the information together we find the following.

\begin{proposition}
\label{proposition-classify-subgraphs}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
Let $I \subset \{1, \ldots, n\}$ be a proper subset of cardinality $\geq 2$
consisting of $(-2)$-indices such that there
does not exist a nonempty proper subset $I' \subset I$
with $a_{i'i} = 0$ for $i' \in I$, $i \in I \setminus I'$.
Then up to reordering the $m_i$'s, $a_{ij}$'s, $w_i$'s
for $i, j \in I$ are as listed in
Lemmas \ref{lemma-two-by-two},
\ref{lemma-three-by-three},
\ref{lemma-four-by-four},
\ref{lemma-D4},
\ref{lemma-five-by-five},
\ref{lemma-D5},
\ref{lemma-long},
\ref{lemma-Dn},
\ref{lemma-E6},
\ref{lemma-E7}, or
\ref{lemma-E8}.
\end{proposition}

\begin{proof}
This follows from the discussion above; see discussion at the
start of Section \ref{section-classify-proper-subgraphs}.
\end{proof}













\section{Classification of minimal type for genus zero and one}
\label{section-classification-genus-one}

\noindent
The title of the section explains it all.

\begin{lemma}[Genus zero]
\label{lemma-genus-zero}
The only minimal numerical type of genus zero is
$n = 1$, $m_1 = 1$, $a_{11} = 0$, $w_1 = 1$, $g_1 = 0$.
\end{lemma}

\begin{proof}
Follows from Lemmas \ref{lemma-non-irreducible-minimal-type-genus-at-least-one}
and \ref{lemma-irreducible}.
\end{proof}

\begin{lemma}[Genus one]
\label{lemma-genus-one}
The minimal numerical types of genus one are up to equivalence
\begin{enumerate}
\item
\label{item-one}
$n = 1$, $a_{11} = 0$, $g_1 = 1$, $m_1, w_1 \geq 1$ arbitrary,
\item
\label{item-two-cycle}
$n = 2$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w \\
2w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up4}
$n = 2$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 4w \\
4w & -8w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-three-cycle}
$n = 3$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & w \\
w & -2w & w \\
w & w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-equal-up3}
$n = 3$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 \\
w & -2w & 3w \\
0 & 3w & -6w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
3w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-equal-down3}
$n = 3$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
3m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-6w & 3w & 0 \\
3w & -6w & 3w \\
0 & 3w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
3w \\
3w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up-up}
$n = 3$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 \\
2w & -4w & 4w \\
0 & 4w & -8w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up-down}
$n = 3$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 \\
2w & -4w & 2w \\
0 & 2w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-down-up}
$n = 3$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 \\
2w & -2w & 2w \\
0 & 2w & -4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
w \\
2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-four-cycle}
$n = 4$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & w \\
w & -2w & w & 0 \\
0 & w & -2w & w \\
w & 0 & w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up-equal-up}
$n = 4$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
2m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 & 0 \\
2w & -4w & 2w & 0 \\
0 & 2w & -4w & 4w \\
0 & 0 & 4w & -8w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
2w \\
4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up-equal-down}
$n = 4$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 & 0 \\
2w & -4w & 2w & 0 \\
0 & 2w & -4w & 2w \\
0 & 0 & 2w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
2w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-down-equal-up}
$n = 4$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 & 0 \\
2w & -2w & w & 0 \\
0 & w & -2w & 2w \\
0 & 0 & 2w & -4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
w \\
w \\
2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-triple-with-up}
$n = 4$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & w & 2w \\
w & -2w & 0 & 0 \\
w & 0 & -2w & 0 \\
2w & 0 & 0 & -4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-triple-with-down}
$n = 4$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
m \\
m \\
2m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 2w & 2w \\
2w & -4w & 0 & 0 \\
2w & 0 & -4w & 0 \\
2w & 0 & 0 & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
2w \\
2w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-five-cycle}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m \\
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & w \\
w & -2w & w & 0 & 0 \\
0 & w & -2w & w & 0 \\
0 & 0 & w & -2w & w \\
w & 0 & 0 & w & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-equal-equal-up-equal}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
3m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 \\
0 & w & -2w & 2w & 0 \\
0 & 0 & 2w & -4w & 2w \\
0 & 0 & 0 & 2w & -4w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
2w \\
2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-equal-equal-down-equal}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
3m \\
4m \\
2m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 & 0 & 0 \\
2w & -4w & 2w & 0 & 0 \\
0 & 2w & -4w & 2w & 0 \\
0 & 0 & 2w & -2w & w \\
0 & 0 & 0 & w & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
2w \\
2w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up-equal-equal-up}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
2m \\
2m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 & 0 & 0 \\
2w & -4w & 2w & 0 & 0 \\
0 & 2w & -4w & 2w & 0 \\
0 & 0 & 2w & -4w & 4w \\
0 & 0 & 0 & 4w & -8w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
2w \\
2w \\
4w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-up-equal-equal-down}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
m \\
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 & 0 & 0 \\
2w & -4w & 2w & 0 & 0 \\
0 & 2w & -4w & 2w & 0 \\
0 & 0 & 2w & -4w & 2w \\
0 & 0 & 0 & 2w & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
2w \\
2w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-down-equal-equal-up}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
2m \\
2m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 & 0 & 0 \\
2w & -2w & w & 0 & 0 \\
0 & w & -2w & w & 0 \\
0 & 0 & w & -2w & 2w \\
0 & 0 & 0 & 2w & -4w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
w \\
w \\
w \\
2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-quadruple}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
m \\
m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & w & w & w \\
w & -2w & 0 & 0 & 0 \\
w & 0 & -2w & 0 & 0 \\
w & 0 & 0 & -2w & 0 \\
w & 0 & 0 & 0 & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-triple-extended-up}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
2m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-4w & 2w & 0 & 0 & 0 \\
2w & -2w & w & 0 & 0 \\
0 & w & -2w & w & w \\
0 & 0 & w & -2w & 0 \\
0 & 0 & w & 0 & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
2w \\
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-triple-extended-down}
$n = 5$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
2m \\
2m \\
2m \\
m \\
m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & 2w & 0 & 0 & 0 \\
2w & -4w & 2w & 0 & 0 \\
0 & 2w & -4w & 2w & 2w \\
0 & 0 & 2w & -4w & 0 \\
0 & 0 & 2w & 0 & -4w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
2w \\
2w \\
2w \\
2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-n-cycle}
$n \geq 6$ and we have an $n$-cycle generalizing (\ref{item-five-cycle}):
\begin{enumerate}
\item $m_1 = \ldots = m_n = m$,
\item $a_{12} = \ldots = a_{(n - 1) n} = w$, $a_{1n} = w$,
and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = \ldots = w_n = w$
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-up-chain-equal-up}
$n \geq 6$ and we have a chain generalizing (\ref{item-up-equal-equal-up}):
\begin{enumerate}
\item $m_1 = \ldots = m_{n - 1} = 2m$, $m_n = m$,
\item $a_{12} = \ldots = a_{(n - 2) (n - 1)} = 2w$, $a_{(n - 1) n} = 4w$,
and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = w$, $w_2 = \ldots = w_{n - 1} = 2w$, $w_n = 4w$
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-up-chain-equal-down}
$n \geq 6$ and we have a chain generalizing (\ref{item-up-equal-equal-down}):
\begin{enumerate}
\item $m_1 = \ldots = m_n = m$,
\item $a_{12} = \ldots = a_{(n - 1) n} = w$,
and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = w$, $w_2 = \ldots = w_{n - 1} = 2w$, $w_n = w$
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-down-chain-equal-up}
$n \geq 6$ and we have a chain generalizing (\ref{item-down-equal-equal-up}):
\begin{enumerate}
\item $m_1 = w$, $w_2 = \ldots = m_{n - 1} = 2m$, $m_n = m$,
\item $a_{12} = 2w$, $a_{23} = \ldots = a_{(n - 2) (n - 1)} = w$,
$a_{(n - 1) n} = 2w$, and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = 2w$, $w_2 = \ldots = w_{n - 1} = w$, $w_n = 2w$
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-Dn-extended-up}
$n \geq 6$ and we have a type generalizing (\ref{item-triple-extended-up}):
\begin{enumerate}
\item $m_1 = m$, $m_2 = \ldots = m_{n - 3} = 2m$, $m_{n - 1} = m_n = m$,
\item $a_{12} = 2w$, $a_{23} = \ldots = a_{(n - 2) (n - 1)} = w$,
$a_{(n - 2) n} = w$, and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = 2w$, $w_2 = \ldots = w_n = w$
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-Dn-extended-down}
$n \geq 6$ and we have a type generalizing (\ref{item-triple-extended-down}):
\begin{enumerate}
\item $m_1 = \ldots = m_{n - 3} = 2m$, $m_{n - 1} = m_n = m$,
\item $a_{12} = \ldots = a_{(n - 2) (n - 1)} = 2w$,
$a_{(n - 2) n} = 2w$, and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = w$, $w_2 = \ldots = w_n = 2w$
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-double-triple}
$n \geq 6$ and we have a type generalizing (\ref{item-quadruple}):
\begin{enumerate}
\item $m_1 = m_2 = m$, $m_3 = \ldots = m_{n - 2} = 2m$, $m_{n - 1} = m_n = m$,
\item $a_{13} = w$, $a_{23} = \ldots = a_{(n - 2) (n - 1)} = w$,
$a_{(n - 2) n} = w$, and for other $i < j$ we have $a_{ij} = 0$,
\item $w_1 = \ldots = w_n = w$,
\end{enumerate}
with $w$ and $m$ arbitrary,
\item
\label{item-E6-completed}
$n = 7$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
3m \\
m \\
2m \\
m \\
2m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 & 0 \\
0 & w & -2w & 0 & w & 0 & w \\
0 & 0 & 0 & -2w & w & 0 & 0 \\
0 & 0 & w & w & -2w & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & -2w & w \\
0 & 0 & w & 0 & 0 & w & -2w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-E7-completed}
$n = 8$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
3m \\
4m \\
3m \\
2m \\
m \\
2m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 & 0 & 0 \\
0 & w & -2w & w & 0 & 0 & 0 & 0 \\
0 & 0 & w & -2w & w & 0 & 0 & w \\
0 & 0 & 0 & w & -2w & w & 0 & 0 \\
0 & 0 & 0 & 0 & w & -2w & w & 0 \\
0 & 0 & 0 & 0 & 0 & w & -2w & 0 \\
0 & 0 & 0 & w & 0 & 0 & 0 & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary,
\item
\label{item-E8-completed}
$n = 9$, and $m_i, a_{ij}, w_i, g_i$ given by
$$
\left(
\begin{matrix}
m \\
2m \\
3m \\
4m \\
5m \\
6m \\
4m \\
2m \\
3m
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
-2w & w & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
w & -2w & w & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & w & -2w & w & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & w & -2w & w & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & w & -2w & w & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & w & -2w & w & 0 & w \\
0 & 0 & 0 & 0 & 0 & w & -2w & w & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & w & -2w & 0 \\
0 & 0 & 0 & 0 & 0 & w & 0 & 0 & -2w \\
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
w \\
w \\
w \\
w \\
w \\
w \\
w \\
w \\
w
\end{matrix}
\right),
\quad
\left(
\begin{matrix}
0 \\
0 \\
0 \\
0 \\
0 \\
0 \\
0 \\
0 \\
0
\end{matrix}
\right)
$$
with $w$ and $m$ arbitrary.
\end{enumerate}
\end{lemma}

\begin{proof}
This is proved in Section \ref{section-classify-proper-subgraphs}.
See discussion at the
start of Section \ref{section-classify-proper-subgraphs}.
\end{proof}






\section{Bounding invariants of numerical types}
\label{section-towards-classification}

\noindent
In our proof of semistable reduction for curves we'll use a bound
on Picard groups of numerical types of genus $g$ which we will prove
in this section.

\begin{lemma}
\label{lemma-bound-neighbours}
Let $n, m_i, a_{ij}, w_i, g_i$ be a numerical type of genus $g$.
Given $i, j$ with $a_{ij} > 0$ we have
$m_ia_{ij} \leq m_j|a_{jj}|$ and $m_iw_i \leq m_j|a_{jj}|$.
\end{lemma}

\begin{proof}
For every index $j$ we have $m_j a_{jj} + \sum_{i \not = j} m_ia_{ij} = 0$.
Thus if we have an upper bound on $|a_{jj}|$ and $m_j$, then we also get an
upper bound on the nonzero (and hence positive) $a_{ij}$ as well as
$m_i$. Recalling that $w_i$ divides $a_{ij}$, the reader easily sees
the lemma is correct.
\end{proof}

\begin{lemma}
\label{lemma-bound-heart}
Fix $g \geq 2$. For every minimal numerical type $n, m_i, a_{ij}, w_i, g_i$
of genus $g$ with $n > 1$ we have
\begin{enumerate}
\item the set $J \subset \{1, \ldots, n\}$ of non-$(-2)$-indices
has at most $2g - 2$ elements,
\item for $j \in J$ we have $g_j < g$,
\item for $j \in J$ we have $m_j|a_{jj}| \leq 6g - 6$, and
\item for $j \in J$ and $i \in \{1, \ldots, n\}$
we have $m_ia_{ij} \leq 6g - 6$.
\end{enumerate}
\end{lemma}

\begin{proof}
Recall that $g = 1 + \sum m_j(w_j(g_j - 1) - \frac{1}{2} a_{jj})$.
For $j \in J$ the contribution $m_j(w_j(g_j - 1) - \frac{1}{2} a_{jj})$
to the genus $g$ is $> 0$ and hence $\geq 1/2$. This uses
Lemma \ref{lemma-minus-one},
Definition \ref{definition-type-minus-one},
Definition \ref{definition-type-minimal},
Lemma \ref{lemma-minus-two}, and
Definition \ref{definition-type-minus-two}; we will use these
results without further mention in the following.
Thus $J$ has at most $2(g - 1)$ elements.
This proves (1).

\medskip\noindent
Recall that $-a_{ii} > 0$ for all $i$ by Lemma \ref{lemma-diagonal-negative}.
Hence for $j \in J$ the contribution $m_j(w_j(g_j - 1) - \frac{1}{2} a_{jj})$
to the genus $g$ is $> m_jw_j(g_j - 1)$. Thus
$$
g - 1 > m_jw_j(g_j - 1) \Rightarrow g_j < (g - 1)/m_jw_j + 1
$$
This indeed implies $g_j < g$ which proves (2).

\medskip\noindent
For $j \in J$ if $g_j > 0$, then the contribution
$m_j(w_j(g_j - 1) - \frac{1}{2} a_{jj})$ to the genus $g$
is $\geq -\frac{1}{2}m_ja_{jj}$ and we immediately conclude
that $m_j|a_{jj}| \leq 2(g - 1)$. Otherwise $a_{jj} = -kw_j$
for some integer $k \geq 3$ (because $j \in J$) and we get
$$
m_jw_j(-1 + \frac{k}{2}) \leq g - 1
\Rightarrow
m_jw_j \leq \frac{2(g - 1)}{k - 2}
$$
Plugging this back into $a_{jj} = -km_jw_j$ we obtain
$$
m_j|a_{jj}| \leq 2(g - 1) \frac{k}{k - 2} \leq 6(g - 1)
$$
This proves (3).

\medskip\noindent
Part (4) follows from Lemma \ref{lemma-bound-neighbours} and (3).
\end{proof}

\begin{lemma}
\label{lemma-bound-wm}
Fix $g \geq 2$. For every minimal numerical type $n, m_i, a_{ij}, w_i, g_i$
of genus $g$ we have $m_i|a_{ij}| \leq 768g$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-bound-neighbours} it suffices to show
$m_i|a_{ii}| \leq 768g$ for all $i$.
Let $J \subset \{1, \ldots, n\}$ be the set of non-$(-2)$-indices
as in Lemma \ref{lemma-bound-heart}. Observe that $J$ is
nonempty as $g \geq 2$. Also $m_j|a_{jj}| \leq 6g$ for $j \in J$
by the lemma.

\medskip\noindent
Suppose we have $j \in J$ and a sequence $i_1, \ldots, i_7$
of $(-2)$-indices such that $a_{ji_1}$ and $a_{i_1i_2}$,
$a_{i_2i_3}$, $a_{i_3i_4}$, $a_{i_4i_5}$, $a_{i_5i_6}$, and
$a_{i_6i_7}$ are nonzero. Then we see from
Lemma \ref{lemma-bound-neighbours}
that $m_{i_1}w_{i_1} \leq 6g$ and $m_{i_1}a_{ji_1} \leq 6g$.
Because $i_1$ is a $(-2)$-index, we have $a_{i_1i_1} = -2w_{i_1}$
and we conclude that $m_{i_1}|a_{i_1i_1}| \leq 12g$.
Repeating the argument we conclude that
$m_{i_2}w_{i_2} \leq 12g$ and $m_{i_2}a_{i_1i_2} \leq 12g$.
Then $m_{i_2}|a_{i_2i_2}| \leq 24g$ and so on.
Eventually we conclude that
$m_{i_k}|a_{i_ki_k}| \leq 2^k(6g) \leq 768g$ for $k = 1, \ldots, 7$.

\medskip\noindent
Let $I \subset \{1, \ldots, n\} \setminus J$ be a maximal connected subset.
In other words, there does not exist a nonempty proper subset
$I' \subset I$ such that
$a_{i'i} = 0$ for $i' \in I'$ and $i \in I \setminus I'$
and $I$ is maximal with this property. In particular, since
a numerical type is connected by definition, we see that there
exists a $j \in J$ and $i \in I$ with $a_{ij} > 0$.
Looking at the classification
of such $I$ in Proposition \ref{proposition-classify-subgraphs}
and using the result of the previous paragraph, we see that
$w_i|a_{ii}| \leq 768g$ for all $i \in I$ unless $I$ is as described in
Lemma \ref{lemma-long} or
Lemma \ref{lemma-Dn}.
Thus we may assume the nonvanishing of $a_{ii'}$, $i, i' \in I$
has either the shape
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{..}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet
}
$$
(which has 3 subcases as detailed in Lemma \ref{lemma-long})
or the shape
$$
\xymatrix{
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{..}[r] &
\bullet \ar@{-}[r] &
\bullet \ar@{-}[r] \ar@{-}[d] &
\bullet \\
& & & & \bullet
}
$$
We will prove the bound holds for the first subcase of
Lemma \ref{lemma-long} and leave the other cases to reader (the argument
is almost exactly the same in those cases).

\medskip\noindent
After renumbering we may assume $I = \{1, \ldots, t\} \subset \{1, \ldots, n\}$
and there is an integer $w$ such that
$$
w = w_1 = \ldots = w_t =
a_{12} = \ldots = a_{(t - 1) t} =
-\frac{1}{2} a_{i_1i_2} = \ldots = -\frac{1}{2} a_{(t - 1) t}
$$
The equalities $a_{ii}m_i + \sum_{j \not = i} a_{ij}m_j = 0$ imply
that we have
$$
2m_2 \geq m_1 + m_3, \ldots, 2m_{t - 1} \geq m_{t - 2} + m_t
$$
Equality holds in $2m_i \geq m_{i - 1} + m_{i + 1}$
if and only if $i$ does not ``meet'' any indices besides
$i - 1$ and $i + 1$. And if $i$ does meet
another index, then this index is in $J$ (by maximality of $I$).
In particular, the map
$\{1, \ldots, t\} \to \mathbf{Z}$, $i \mapsto m_i$ is concave.

\medskip\noindent
Let $m = \max(m_i, i \in \{1, \ldots, t\})$. Then
$m_i|a_{ii}| \leq 2mw$ for $i \leq t$ and
our goal is to show that $2mw \leq 768g$.
Let $s$, resp.\ $s'$ in $\{1, \ldots, t\}$ be the
smallest, resp.\ biggest index with $m_s = m = m_{s'}$.
By concavity we see that $m_i = m$ for $s \leq i \leq s'$.
If $s > 1$, then we do not have equality in
$2m_s \geq m_{s - 1} + m_{s + 1}$
and we see that $s$ meets an index from $J$.
In this case $2mw \leq 12g$ by the result of the second paragraph
of the proof.
Similarly, if $s' < t$, then $s'$ meets an index from $J$
and we get $2mw \leq 12g$ as well.
But if $s = 1$ and $s' = t$, then we conclude
that $a_{ij} = 0$ for all $j \in J$ and $i \in \{2, \ldots, t - 1\}$.
But as we've seen that there must be a pair $(i, j) \in I \times J$
with $a_{ij} > 0$, we conclude that this happens either with
$i = 1$ or with $i = t$ and we conclude $2mw \leq 12g$
in the same manner as before (as $m_1 = m = m_t$ in this case).
\end{proof}

\begin{proposition}
\label{proposition-bound-picard-group}
Let $g \geq 2$. For every numerical type $T$ of genus $g$
and prime number $\ell > 768g$ we have
$$
\dim_{\mathbf{F}_\ell} \Pic(T)[\ell] \leq g
$$
where $\Pic(T)$ is as in Definition \ref{definition-picard-group}.
If $T$ is minimal, then we even have
$$
\dim_{\mathbf{F}_\ell} \Pic(T)[\ell] \leq g_{top} \leq g
$$
where $g_{top}$ as in Definition \ref{definition-top-genus}.
\end{proposition}

\begin{proof}
Say $T$ is given by $n, m_i, a_{ij}, w_i, g_i$.
If $T$ is not minimal, then there exists a $(-1)$-index.
After replacing $T$ by an equivalent type we may assume
$n$ is a $(-1)$-index. Applying Lemma \ref{lemma-contract-picard-group}
we find $\Pic(T) \subset \Pic(T')$ where $T'$
is a numerical type of genus $g$ (Lemma \ref{lemma-contract})
with $n - 1$ indices. Thus we conclude by induction on $n$
provided we prove the lemma for minimal numerical types.

\medskip\noindent
Assume that $T$ is a minimal numerical type of genus $\geq 2$.
Observe that $g_{top} \leq g$ by Lemma \ref{lemma-genus-nonnegative}.
If $A = (a_{ij})$ then since $\Pic(T) \subset \Coker(A)$
by Lemma \ref{lemma-picard-T-and-A}. Thus it suffices to prove
the lemma for $\Coker(A)$.
By Lemma \ref{lemma-bound-wm} we see that $m_i|a_{ij}| \leq 768g$ for
all $i, j$.
Hence the result by Lemma \ref{lemma-recurring-symmetric-integer}.
\end{proof}







\section{Models}
\label{section-models}

\noindent
In this chapter $R$ will be a discrete valuation ring and $K$ will
be its fraction field. If needed we will denote $\pi \in R$ a
uniformizer and $k = R/(\pi)$ its residue field.

\medskip\noindent
Let $V$ be an algebraic $K$-scheme
(Varieties, Definition \ref{varieties-definition-algebraic-scheme}).
A {\it model} for $V$ will
mean a flat finite type\footnote{Occasionally it is useful to
allow models to be locally of finite type over $R$, but we'll
cross that bridge when we come to it.}
morphism $X \to \Spec(R)$ endowed with
an isomorphism $V \to X_K = X \times_{\Spec(R)} \Spec(K)$. We often
will identify $V$ and the generic fibre $X_K$ of $X$ and
just write $V = X_K$.
The special fibre is $X_k = X \times_{\Spec(R)} \Spec(k)$.
A {\it morphism of models $X \to X'$ for $V$}
is a morphism $X \to X'$ of schemes over $R$ which induces
the identity on $V$.

\medskip\noindent
We will say {\it $X$ is a proper model of $V$} if $X$ is a model
of $V$ and the structure morphism $X \to \Spec(R)$ is proper.
Similarly for separated models, smooth models, and add more here.
We will say {\it $X$ is a regular model of $V$} if $X$ is a model
of $V$ and $X$ is a regular scheme.
Similarly for normal models, reduced models, and add more here.

\medskip\noindent
Let $R \subset R'$ be an extension of discrete valuation rings
(More on Algebra, Definition
\ref{more-algebra-definition-extension-discrete-valuation-rings}).
This induces an extension $K'/K$ of fraction fields.
Given an algebraic scheme $V$ over $K$, denote $V'$ the
base change $V \times_{\Spec(K)} \Spec(K')$. Then there is
a functor
$$
\text{models for }V\text{ over }R
\longrightarrow
\text{models for }V'\text{ over }R'
$$
sending $X$ to $X \times_{\Spec(R)} \Spec(R')$.

\begin{lemma}
\label{lemma-closure-is-model}
Let $V_1 \to V_2$ be a closed immersion of algebraic schemes over $K$.
If $X_2$ is a model for $V_2$, then the scheme theoretic image
of $V_1 \to X_2$ is a model for $V_1$.
\end{lemma}

\begin{proof}
Using
Morphisms, Lemma \ref{morphisms-lemma-quasi-compact-scheme-theoretic-image} and
Example \ref{morphisms-example-scheme-theoretic-image}
this boils down to the following algebra statement.
Let $A_1$ be a finite type $R$-algebra flat over $R$.
Let $A_1 \otimes_R K \to B_2$ be a surjection. Then
$A_2 = A_1 / \Ker(A_1 \to B_2)$ is a finite type $R$-algebra
flat over $R$ such that $B_2 = A_2 \otimes_R K$.
We omit the detailed proof; use
More on Algebra, Lemma \ref{more-algebra-lemma-dedekind-torsion-free-flat}
to prove that $A_2$ is flat.
\end{proof}

\begin{lemma}
\label{lemma-normalization}
Let $X$ be a model of a geometrically normal variety $V$ over $K$.
Then the normalization $\nu : X^\nu \to X$ is finite and
the base change of $X^\nu$ to the completion $R^\wedge$
is the normalization of the base change of $X$. Moreover, for
each $x \in X^\nu$ the completion of $\mathcal{O}_{X^\nu, x}$
is normal.
\end{lemma}

\begin{proof}
Observe that $R^\wedge$ is a discrete valuation ring
(More on Algebra, Lemma \ref{more-algebra-lemma-completion-dvr}).
Set $Y = X \times_{\Spec(R)} \Spec(R^\wedge)$.
Since $R^\wedge$ is a discrete valuation ring, we see that
$$
Y \setminus Y_k =
Y \times_{\Spec(R^\wedge)} \Spec(K^\wedge) =
V \times_{\Spec(K)} \Spec(K^\wedge)
$$
where $K^\wedge$ is the fraction field of $R^\wedge$.
Since $V$ is geometrically normal, we find that this is
a normal scheme. Hence the first part of the lemma follows from
Resolution of Surfaces, Lemma \ref{resolve-lemma-normalization-completion}.

\medskip\noindent
To prove the second part we may assume $X$ and $Y$ are normal
(by the first part). If $x$ is in the generic fibre, then
$\mathcal{O}_{X, x} = \mathcal{O}_{V, x}$ is a normal local
ring essentially of finite type over a field. Such a ring is
excellent (More on Algebra, Proposition
\ref{more-algebra-proposition-ubiquity-excellent}).
If $x$ is a point of the special fibre with image $y \in Y$, then
$\mathcal{O}_{X, x}^\wedge = \mathcal{O}_{Y, y}^\wedge$
by Resolution of Surfaces, Lemma \ref{resolve-lemma-iso-completions}.
In this case $\mathcal{O}_{Y, y}$ is a excellent normal local domain
by the same reference as before as $R^\wedge$ is excellent.
If $B$ is a excellent local normal domain, then the completion
$B^\wedge$ is normal (as $B \to B^\wedge$ is regular and
More on Algebra, Lemma \ref{more-algebra-lemma-normal-goes-up} applies).
This finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-regular}
Let $X$ be a model of a smooth curve $C$ over $K$. Then
there exists a resolution of singularities of $X$
and any resolution is a model of $C$.
\end{lemma}

\begin{proof}
We check condition (4) of Lipman's theorem
(Resolution of Surfaces, Theorem \ref{resolve-theorem-resolve}) hold.
This is clear from Lemma \ref{lemma-normalization}
except for the statement that $X^\nu$ has finitely many
singular points. To see this we can use that $R$ is J-2 by
More on Algebra, Proposition \ref{more-algebra-proposition-ubiquity-J-2}
and hence the nonsingular locus is open in $X^\nu$.
Since $X^\nu$ is normal of dimension $\leq 2$, the singular points
are closed, hence closedness of the singular locus
means there are finitely many of them (as $X$ is quasi-compact).
Observe that any resolution of $X$ is a modification of $X$
(Resolution of Surfaces, Definition \ref{resolve-definition-resolution}).
This will be an isomorphism over the normal locus of $X$ by Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}.
Since the set of normal points includes
$C = X_K$ we conclude any resolution is a model of $C$.
\end{proof}

\begin{definition}
\label{definition-minimal-model}
Let $C$ be a smooth projective curve over $K$ with
$H^0(C, \mathcal{O}_C) = K$. A {\it minimal model}
will be a regular, proper model $X$ for $C$ such that
$X$ does not contain an exceptional curve of the first kind
(Resolution of Surfaces, Section \ref{resolve-section-minus-one}).
\end{definition}

\noindent
Really such a thing should be called a minimal regular proper model
or even a relatively minimal regular projective model. But as long
as we stick to models over discrete valuation rings (as we will
in this chapter), no confusion should arise.

\medskip\noindent
Minimal models always exist
(Proposition \ref{proposition-exists-minimal-model}) and are unique
when the genus is $> 0$ (Lemma \ref{lemma-minimal-model-unique}).

\begin{lemma}
\label{lemma-pre-exists-minimal-model}
\begin{slogan}
A regular proper model of a curve is obtained by successive blowups
from a minimal model
\end{slogan}
Let $C$ be a smooth projective curve over $K$ with
$H^0(C, \mathcal{O}_C) = K$. If $X$ is a regular proper
model for $C$, then there exists a sequence of morphisms
$$
X = X_m \to X_{m - 1} \to \ldots \to X_1 \to X_0
$$
of proper regular models of $C$, such that each morphism is a
contraction of an exceptional curve of the first kind, and such
that $X_0$ is a minimal model.
\end{lemma}

\begin{proof}
By Resolution of Surfaces, Lemma \ref{resolve-lemma-regular-dim-2-projective}
we see that $X$ is projective over $R$. Hence $X$ has an ample
invertible sheaf by
More on Morphisms, Lemma \ref{more-morphisms-lemma-projective}
(we will use this below).
Let $E \subset X$ be an exceptional curve of the first kind.
See Resolution of Surfaces, Section \ref{resolve-section-minus-one}.
By Resolution of Surfaces, Lemma \ref{resolve-lemma-contract-ample}
we can contract $E$ by a morphism $X \to X'$ such that $X'$ is
regular and is projective over $R$. Clearly, the number of
irreducible components of $X'_k$ is exactly one less than the
number of irreducible components of $X_k$. Thus we can only
perform a finite number of these contractions until we
obtain a minimal model.
\end{proof}

\begin{proposition}
\label{proposition-exists-minimal-model}
Let $C$ be a smooth projective curve over $K$ with
$H^0(C, \mathcal{O}_C) = K$. A minimal model exists.
\end{proposition}

\begin{proof}
Choose a closed immersion $C \to \mathbf{P}^n_K$. Let
$X$ be the scheme theoretic image of $C \to \mathbf{P}^n_R$.
Then $X \to \Spec(R)$ is a projective model of $C$ by
Lemma \ref{lemma-closure-is-model}.
By Lemma \ref{lemma-regular} there exists a resolution
of singularities $X' \to X$ and $X'$ is a model for $C$.
Then $X' \to \Spec(R)$ is proper as a composition of proper morphisms.
Then we may apply Lemma \ref{lemma-pre-exists-minimal-model}
to obtain a minimal model.
\end{proof}





\section{The geometry of a regular model}
\label{section-special-fibre}

\noindent
In this section we describe the geometry of a proper regular model $X$ of a
smooth projective curve $C$ over $K$ with $H^0(C, \mathcal{O}_C) = K$.

\begin{lemma}
\label{lemma-divisor-special-fiber}
Let $X$ be a regular model of a smooth curve $C$ over $K$.
\begin{enumerate}
\item the special fibre $X_k$ is an effective Cartier divisor on $X$,
\item each irreducible component $C_i$ of $X_k$ is an effective
Cartier divisor on $X$,
\item $X_k = \sum m_i C_i$ (sum of effective Cartier divisors)
where $m_i$ is the multiplicity of $C_i$ in $X_k$,
\item $\mathcal{O}_X(X_k) \cong \mathcal{O}_X$.
\end{enumerate}
\end{lemma}

\begin{proof}
Recall that $R$ is a discrete valuation ring with uniformizer $\pi$
and residue field $k = R/(\pi)$. Because $X \to \Spec(R)$ is flat,
the element $\pi$ is a nonzerodivisor affine locally on $X$
(see More on Algebra, Lemma
\ref{more-algebra-lemma-dedekind-torsion-free-flat}). Thus
if $U = \Spec(A) \subset X$ is an affine open, then
$$
X_K \cap U = U_k = \Spec(A \otimes_R k) = \Spec(A/\pi A)
$$
and $\pi$ is a nonzerodivisor in $A$.
Hence $X_k = V(\pi)$ is an effective Cartier divisor by
Divisors, Lemma \ref{divisors-lemma-characterize-effective-Cartier-divisor}.
Hence (1) is true.

\medskip\noindent
The discussion above shows that the pair $(\mathcal{O}_X(X_k), 1)$
is isomorphic to the pair $(\mathcal{O}_X, \pi)$ which proves (4).

\medskip\noindent
By Divisors, Lemma \ref{divisors-lemma-effective-Cartier-divisor-is-a-sum}
there exist pairwise distinct integral effective Cartier divisors
$D_i \subset X$ and integers $a_i \geq 0$ such that $X_k = \sum a_i D_i$.
We can throw out those divisors $D_i$ such that $a_i = 0$. Then it is
clear (from the definition of addition of effective Cartier
divisors) that $X_k = \bigcup D_i$ set theoretically. Thus $C_i = D_i$
are the irreducible components of $X_k$ which proves (2).
Let $\xi_i$ be the generic point of $C_i$.
Then $\mathcal{O}_{X, \xi_i}$ is a discrete valuation ring
(Divisors, Lemma \ref{divisors-lemma-integral-effective-Cartier-divisor-dvr}).
The uniformizer $\pi_i \in \mathcal{O}_{X, \xi_i}$ is a local equation
for $C_i$ and the image of $\pi$ is a local equation for $X_k$.
Since $X_k = \sum a_i C_i$ we see that $\pi$ and $\pi_i^{a_i}$
generate the same ideal in $\mathcal{O}_{X, \xi_i}$.
On the other hand, the multiplicity of $C_i$ in $X_k$ is
$$
m_i = \text{length}_{\mathcal{O}_{C_i, \xi_i}} \mathcal{O}_{X_k, \xi_i} =
\text{length}_{\mathcal{O}_{C_i, \xi_i}} \mathcal{O}_{X, \xi_i}/(\pi) =
\text{length}_{\mathcal{O}_{C_i, \xi_i}} \mathcal{O}_{X, \xi_i}/(\pi_i^{a_i}) =
a_i
$$
See Chow Homology, Definition
\ref{chow-definition-cycle-associated-to-closed-subscheme}.
Thus $a_i = m_i$ and (3) is proved.
\end{proof}

\begin{lemma}
\label{lemma-gorenstein}
Let $X$ be a regular model of a smooth curve $C$ over $K$. Then
\begin{enumerate}
\item $X \to \Spec(R)$ is a Gorenstein morphism of relative dimension $1$,
\item each of the irreducible components $C_i$ of $X_k$ is Gorenstein.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $X \to \Spec(R)$ is flat, to prove (1)
it suffices to show that the fibres are Gorenstein
(Duality for Schemes, Lemma \ref{duality-lemma-gorenstein-morphism}).
The generic fibre is a smooth curve, which is regular and hence Gorenstein
(Duality for Schemes, Lemma \ref{duality-lemma-regular-gorenstein}).
For the special fibre $X_k$ we use that it is an effective
Cartier divisor on a regular (hence Gorenstein) scheme and hence
Gorenstein for example by Dualizing Complexes, Lemma
\ref{dualizing-lemma-gorenstein-divide-by-nonzerodivisor}.
The curves $C_i$ are Gorenstein by the same argument.
\end{proof}

\begin{situation}
\label{situation-regular-model}
Let $R$ be a discrete valuation ring with fraction field $K$,
residue field $k$, and uniformizer $\pi$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
Let $X$ be a regular proper model of $C$.
Let $C_1, \ldots, C_n$ be the irreducible components of the special
fibre $X_k$. Write $X_k = \sum m_i C_i$ as in
Lemma \ref{lemma-divisor-special-fiber}.
\end{situation}

\begin{lemma}
\label{lemma-regular-model-connected}
In Situation \ref{situation-regular-model} the special fibre $X_k$ is connected.
\end{lemma}

\begin{proof}
Consequence of More on Morphisms, Lemma
\ref{more-morphisms-lemma-geometrically-connected-fibres-towards-normal}.
\end{proof}

\begin{lemma}
\label{lemma-regular-model-pic}
In Situation \ref{situation-regular-model} there is an exact sequence
$$
0 \to \mathbf{Z} \to \mathbf{Z}^{\oplus n} \to
\Pic(X) \to \Pic(C) \to 0
$$
where the first map sends $1$ to $(m_1, \ldots, m_n)$ and the second
maps sends the $i$th basis vector to $\mathcal{O}_X(C_i)$.
\end{lemma}

\begin{proof}
Observe that $C \subset X$ is an open subscheme. The restriction
map $\Pic(X) \to \Pic(C)$ is surjective by
Divisors, Lemma \ref{divisors-lemma-extend-invertible-module}.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module
such that there is an isomorphism $s : \mathcal{O}_C \to \mathcal{L}|_C$.
Then $s$ is a regular meromorphic section of $\mathcal{L}$
and we see that $\text{div}_\mathcal{L}(s) = \sum a_i C_i$
for some $a_i \in \mathbf{Z}$
(Divisors, Definition \ref{divisors-definition-divisor-invertible-sheaf}).
By Divisors, Lemma \ref{divisors-lemma-normal-c1-injective}
(and the fact that $X$ is normal)
we conclude that $\mathcal{L} = \mathcal{O}_X(\sum a_iC_i)$.
Finally, suppose that $\mathcal{O}_X(\sum a_i C_i) \cong \mathcal{O}_X$.
Then there exists an element $g$ of the function field of $X$
with $\text{div}_X(g) = \sum a_i C_i$. In particular the rational
function $g$ has no zeros or poles on the generic fibre $C$ of $X$.
Since $C$ is a normal scheme this implies $g \in H^0(C, \mathcal{O}_C) = K$.
Thus $g = \pi^a u$ for some $a \in \mathbf{Z}$ and $u \in R^*$.
We conclude that $\text{div}_X(g) = a \sum m_i C_i$ and the proof
is complete.
\end{proof}

\noindent
In Situation \ref{situation-regular-model} for every invertible
$\mathcal{O}_X$-module $\mathcal{L}$ and every $i$ we get an integer
$$
\deg(\mathcal{L}|_{C_i}) =
\chi(C_i, \mathcal{L}|_{C_i}) - \chi(C_i, \mathcal{O}_{C_i})
$$
by taking the degree of the restriction of $\mathcal{L}$ to $C_i$
relative to the ground field $k$\footnote{Observe that it may happen
that the field $\kappa_i = H^0(C_i, \mathcal{O}_{C_i})$ is strictly bigger
than $k$. In this case every invertible module on $C_i$ has
degree (as defined above) divisible by $[\kappa_i : k]$.}
as in Varieties, Section \ref{varieties-section-divisors-curves}.

\begin{lemma}
\label{lemma-intersection-pairing}
In Situation \ref{situation-regular-model} given $\mathcal{L}$ an invertible
$\mathcal{O}_X$-module and
$a = (a_1, \ldots, a_n) \in \mathbf{Z}^{\oplus n}$ we define
$$
\langle a, \mathcal{L} \rangle = \sum a_i\deg(\mathcal{L}|_{C_i})
$$
Then $\langle , \rangle$ is bilinear and for
$b = (b_1, \ldots, b_n) \in \mathbf{Z}^{\oplus n}$ we have
$$
\left\langle a, \mathcal{O}_X(\sum b_i C_i) \right\rangle =
\left\langle b, \mathcal{O}_X(\sum a_i C_i) \right\rangle
$$
\end{lemma}

\begin{proof}
Bilinearity is immediate from the definition and
Varieties, Lemma \ref{varieties-lemma-degree-tensor-product}.
To prove symmetry it suffices to assume $a$ and $b$ are
standard basis vectors in $\mathbf{Z}^{\oplus n}$.
Hence it suffices to prove that
$$
\deg(\mathcal{O}_X(C_j)|_{C_i}) = \deg(\mathcal{O}_X(C_i)|_{C_j})
$$
for all $1 \leq i, j \leq n$. If $i = j$ there is nothing to prove.
If $i \not = j$, then the canonical section $1$ of $\mathcal{O}_X(C_j)$
restricts to a nonzero (hence regular) section of $\mathcal{O}_X(C_j)|_{C_i}$
whose zero scheme is exactly $C_i \cap C_j$ (scheme theoretic intersection).
In other words, $C_i \cap C_j$ is an effective Cartier divisor on $C_i$
and
$$
\deg(\mathcal{O}_X(C_j)|_{C_i}) = \deg(C_i \cap C_j)
$$
by Varieties, Lemma \ref{varieties-lemma-degree-effective-Cartier-divisor}.
By symmetry we obtain the same (!) formula for the other side
and the proof is complete.
\end{proof}

\noindent
In Situation \ref{situation-regular-model} it is often convenient to think
of $\mathbf{Z}^{\oplus n}$ as the free abelian group on the set
$\{C_1, \ldots, C_n\}$. We will indicate an element of this group
as $\sum a_i C_i$; here we think of this as a formal sum although
equivalently we may (and we sometimes do)
think of such a sum as a Weil divisor on $X$
supported on the special fibre $X_k$. Now
Lemma \ref{lemma-intersection-pairing}
allows us to define a symmetric bilinear form $(\ \cdot\ )$
on this free abelian group by the rule
\begin{equation}
\label{equation-form}
\left(\sum a_i C_i \cdot \sum b_j C_j\right) =
\left\langle a, \mathcal{O}_X(\sum b_j C_j) \right\rangle =
\left\langle b, \mathcal{O}_X(\sum a_i C_i) \right\rangle
\end{equation}
We will prove some properties of this bilinear form.

\begin{lemma}
\label{lemma-properties-form}
In Situation \ref{situation-regular-model} the symmetric bilinear form
(\ref{equation-form}) has the following properties
\begin{enumerate}
\item $(C_i \cdot C_j) \geq 0$ if $i \not = j$ with equality if and only
if $C_i \cap C_j = \emptyset$,
\item $(\sum m_i C_i \cdot C_j) = 0$,
\item there is no nonempty proper subset $I \subset \{1, \ldots, n\}$
such that $(C_i \cdot C_j) = 0$ for $i \in I$, $j \not \in I$.
\item $(\sum a_i C_i \cdot \sum a_i C_i) \leq 0$ with equality if and
only if there exists a $q \in \mathbf{Q}$ such that $a_i = qm_i$
for $i = 1, \ldots, n$,
\end{enumerate}
\end{lemma}

\begin{proof}
In the proof of Lemma \ref{lemma-intersection-pairing} we saw that
$(C_i \cdot C_j) = \deg(C_i \cap C_j)$ if $i \not = j$. This is
$\geq 0$ and $> 0 $ if and only if $C_i \cap C_j \not = \emptyset$.
This proves (1).

\medskip\noindent
Proof of (2). This is true because by Lemma \ref{lemma-divisor-special-fiber}
the invertible sheaf associated to $\sum m_i C_i$
is trivial and the trivial sheaf has degree zero.

\medskip\noindent
Proof of (3). This is expressing the fact that $X_k$ is connected
(Lemma \ref{lemma-regular-model-connected})
via the description of the intersection products given in the proof of (1).

\medskip\noindent
Part (4) follows from (1), (2), and (3) by
Lemma \ref{lemma-recurring-symmetric-real}.
\end{proof}

\begin{lemma}
\label{lemma-multiple-fibre-normal-bundle}
In Situation \ref{situation-regular-model} set $d = \gcd(m_1, \ldots, m_n)$
and let $D = \sum (m_i/d)C_i$ as an effective Cartier divisor.
Then $\mathcal{O}_X(D)$ has order dividing $d$ in $\Pic(X)$
and $\mathcal{C}_{D/X}$ an invertible $\mathcal{O}_D$-module
of order dividing $d$ in $\Pic(D)$.
\end{lemma}

\begin{proof}
We have
$$
\mathcal{O}_X(D)^{\otimes d} = \mathcal{O}_X(dD) =
\mathcal{O}_X(X_k) = \mathcal{O}_X
$$
by Lemma \ref{lemma-divisor-special-fiber}.
We conclude as $\mathcal{C}_{D/X}$ is the pullback of
$\mathcal{O}_X(-D)$.
\end{proof}

\begin{lemma}
\label{lemma-regular-model-field}
\begin{reference}
\cite[Lemma 2.6]{Artin-Winters}
\end{reference}
In Situation \ref{situation-regular-model} let $d = \gcd(m_1, \ldots, m_n)$.
Let $D = \sum (m_i/d) C_i$ as an effective Cartier divisor. Then there exists
a sequence of effective Cartier divisors
$$
(X_k)_{red} = Z_0 \subset Z_1 \subset \ldots \subset Z_m = D
$$
such that $Z_j = Z_{j - 1} + C_{i_j}$ for some $i_j \in \{1, \ldots, n\}$
for $j = 1, \ldots, m$ and such that $H^0(Z_j, \mathcal{O}_{Z_j})$
is a field finite over $k$ for $j = 0, \ldots m$.
\end{lemma}

\begin{proof}
The reduction $D_{red} = (X_k)_{red} = \sum C_i$ is connected
(Lemma \ref{lemma-regular-model-connected}) and proper over $k$. Hence
$H^0(D_{red}, \mathcal{O})$ is a field and a finite extension of
$k$ by Varieties, Lemma
\ref{varieties-lemma-proper-geometrically-reduced-global-sections}.
Thus the result for $Z_0 = D_{red} = (X_k)_{red}$ is true.
Suppose that we have already constructed
$$
(X_k)_{red} = Z_0 \subset Z_1 \subset \ldots \subset Z_t \subset D
$$
with $Z_j = Z_{j - 1} + C_{i_j}$ for some $i_j \in \{1, \ldots, n\}$
for $j = 1, \ldots, t$ and such that $H^0(Z_j, \mathcal{O}_{Z_j})$
is a field finite over $k$ for $j = 0, \ldots, t$.
Write $Z_t = \sum a_i C_i$ with $1 \leq a_i \leq m_i/d$.
If $a_i = m_i/d$ for all $i$, then $Z_t = D$ and the lemma is proved.
If not, then $a_i < m_i/d$ for some $i$ and it follows that
$(Z_t \cdot Z_t) < 0$ by Lemma \ref{lemma-properties-form}. This means that
$(D - Z_t \cdot Z_t) > 0$ because $(D \cdot Z_t) = 0$ by the lemma.
Thus we can find an $i$ with $a_i < m_i/d$ such that
$(C_i \cdot Z_t) > 0$. Set $Z_{t + 1} = Z_t + C_i$ and $i_{t + 1} = i$.
Consider the short exact sequence
$$
0 \to \mathcal{O}_X(-Z_t)|_{C_i} \to \mathcal{O}_{Z_{t + 1}} \to
\mathcal{O}_{Z_t} \to 0
$$
of Divisors, Lemma \ref{divisors-lemma-ses-add-divisor}.
By our choice of $i$ we see that
$\mathcal{O}_X(-Z_t)|_{C_i}$ is an invertible sheaf of negative degree
on the proper curve $C_i$, hence it has no nonzero global sections
(Varieties, Lemma \ref{varieties-lemma-check-invertible-sheaf-trivial}).
We conclude that $H^0(\mathcal{O}_{Z_{t + 1}}) \subset H^0(\mathcal{O}_{Z_t})$
is a field (this is clear but also follows from
Algebra, Lemma \ref{algebra-lemma-integral-under-field})
and a finite extension of $k$. Thus we have extended the sequence.
Since the process must stop, for example because $t \leq \sum (m_i/d - 1)$,
this finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-regular-model-genus}
\begin{reference}
\cite[Lemma 2.6]{Artin-Winters}
\end{reference}
In Situation \ref{situation-regular-model} let $d = \gcd(m_1, \ldots, m_n)$.
Let $D = \sum (m_i/d) C_i$ as an effective Cartier divisor on $X$. Then
$$
1 - g_C = d [\kappa : k] (1 - g_D)
$$
where $g_C$ is the genus of $C$, $g_D$ is the genus of $D$, and
$\kappa = H^0(D, \mathcal{O}_D)$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-regular-model-field} we see that $\kappa$ is a field
and a finite extension of $k$. Since also $H^0(C, \mathcal{O}_C) = K$
we see that the genus of $C$ and $D$ are defined (see
Algebraic Curves, Definition \ref{curves-definition-genus}) and
we have $g_C = \dim_K H^1(C, \mathcal{O}_C)$ and
$g_D = \dim_\kappa H^1(D, \mathcal{O}_D)$.
By Derived Categories of Schemes, Lemma
\ref{perfect-lemma-chi-locally-constant-geometric}
we have
$$
1 - g_C = \chi(C, \mathcal{O}_C) =
\chi(X_k, \mathcal{O}_{X_k}) = \dim_k H^0(X_k, \mathcal{O}_{X_k})
- \dim_k H^1(X_k, \mathcal{O}_{X_k})
$$
We claim that
$$
\chi(X_k, \mathcal{O}_{X_k}) = d \chi(D, \mathcal{O}_D)
$$
This will prove the lemma because
$$
\chi(D, \mathcal{O}_D) =
\dim_k H^0(D, \mathcal{O}_D) - \dim_k H^1(D, \mathcal{O}_D) =
[\kappa : k](1 - g_D)
$$
Observe that $X_k = dD$ as an effective Cartier divisor.
To prove the claim we prove by induction on $1 \leq r \leq d$ that
$\chi(rD, \mathcal{O}_{rD}) = r \chi(D, \mathcal{O}_D)$.
The base case $r = 1$ is trivial. If $1 \leq r < d$, then we consider
the short exact sequence
$$
0 \to \mathcal{O}_X(rD)|_D \to \mathcal{O}_{(r + 1)D} \to
\mathcal{O}_{rD} \to 0
$$
of Divisors, Lemma \ref{divisors-lemma-ses-add-divisor}. By additivity
of Euler characteristics
(Varieties, Lemma \ref{varieties-lemma-euler-characteristic-additive})
it suffices to prove that
$\chi(D, \mathcal{O}_X(rD)|_D) = \chi(D, \mathcal{O}_D)$.
This is true because $\mathcal{O}_X(rD)|_D$ is a torsion
element of $\Pic(D)$ (Lemma \ref{lemma-multiple-fibre-normal-bundle})
and because the degree of a line bundle is additive
(Varieties, Lemma \ref{varieties-lemma-degree-tensor-product})
hence zero for torsion invertible sheaves.
\end{proof}

\begin{lemma}
\label{lemma-exceptional-curves-dont-meet}
In Situation \ref{situation-regular-model} given a pair of indices $i, j$
such that $C_i$ and $C_j$ are exceptional curves of the first kind
and $C_i \cap C_j \not = \emptyset$, then
$n = 2$, $m_1 = m_2 = 1$, $C_1 \cong \mathbf{P}^1_k$,
$C_2 \cong \mathbf{P}^1_k$, $C_1$ and $C_2$ meet in a $k$-rational point,
and $C$ has genus $0$.
\end{lemma}

\begin{proof}
Choose isomorphisms $C_i = \mathbf{P}^1_{\kappa_i}$ and
$C_j = \mathbf{P}^1_{\kappa_j}$. The scheme $C_i \cap C_j$
is a nonempty effective Cartier divisor in both $C_i$ and $C_j$.
Hence
$$
(C_i \cdot C_j) = \deg(C_i \cap C_j) \geq \max([\kappa_i: k], [\kappa_j : k])
$$
The first equality was shown in the proof of
Lemma \ref{lemma-intersection-pairing}.
On the other hand, the self intersection $(C_i \cdot C_i)$ is equal
to the degree of $\mathcal{O}_X(C_i)$ on $C_i$ which is $-[\kappa_i : k]$
as $C_i$ is an exceptional curve of the first kind. Similarly for
$C_j$. By Lemma \ref{lemma-properties-form}
$$
0 \geq (C_i + C_j)^2 = -[\kappa_i : k] + 2(C_i \cdot C_j) - [\kappa_j : k]
$$
This implies that $[\kappa_i : k] = \deg(C_i \cap C_j) = [\kappa_j : k]$
and that we have $(C_i + C_j)^2 = 0$. Looking at the lemma again
we conclude that $n = 2$, $\{1, 2\} = \{i, j\}$, and $m_1 = m_2$.
Moreover, the scheme theoretic intersection $C_i \cap C_j$ consists of
a single point $p$ with residue field $\kappa$ and
$\kappa_i \to \kappa \leftarrow \kappa_j$ are isomorphisms.
Let $D = C_1 + C_2$ as effective Cartier divisor on $X$.
Observe that $D$ is the scheme theoretic union of $C_1$ and $C_2$
(Divisors, Lemma \ref{divisors-lemma-sum-effective-Cartier-divisors-union})
hence we have a short exact sequence
$$
0 \to \mathcal{O}_D \to \mathcal{O}_{C_1} \oplus \mathcal{O}_{C_2} \to
\mathcal{O}_p \to 0
$$
by Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-union}.
Since we know the cohomology of $C_i \cong \mathbf{P}^1_\kappa$
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-cohomology-projective-space-over-ring})
we conclude from the long exact cohomology sequence that
$H^0(D, \mathcal{O}_D) = \kappa$ and
$H^1(D, \mathcal{O}_D) = 0$. By Lemma \ref{lemma-regular-model-genus}
we conclude
$$
1 - g_C = d[\kappa : k](1 - 0)
$$
where $d = m_1 = m_2$. It follows that $g_C = 0$ and $d = m_1 = m_2 = 1$
and $\kappa = k$.
\end{proof}





\section{Uniqueness of the minimal model}
\label{section-uniqueness}

\noindent
If the genus of the generic fibre is positive, then minimal models are unique
(Lemma \ref{lemma-minimal-model-unique}) and consequently have a suitable
mapping property (Lemma \ref{lemma-minimal-model-mapping-property}).

\begin{lemma}
\label{lemma-minimal-model-unique}
Let $C$ be a smooth projective curve over $K$ with
$H^0(C, \mathcal{O}_C) = K$ and genus $> 0$.
There is a unique minimal model for $C$.
\end{lemma}

\begin{proof}
We have already proven the hard part of the lemma which is the existence
of a minimal model (whose proof relies on
resolution of surface singularities), see
Proposition \ref{proposition-exists-minimal-model}.
To prove uniqueness, suppose that $X$ and $Y$ are two
minimal models. By
Resolution of Surfaces, Lemma \ref{resolve-lemma-birational-regular-surfaces}
there exists a diagram of $S$-morphisms
$$
X = X_0 \leftarrow X_1 \leftarrow \ldots \leftarrow X_n = Y_m
\to \ldots \to Y_1 \to Y_0 = Y
$$
where each morphism is a blowup in a closed point. The
exceptional fibre of the morphism $X_n \to X_{n - 1}$ is an
exceptional curve of the first kind $E$. We claim that $E$ is
contracted to a point under the morphism $X_n = Y_m \to Y$.
If this is true, then $X_n \to Y$ factors through $X_{n - 1}$ by
Resolution of Surfaces, Lemma \ref{resolve-lemma-factor-through-contraction}.
In this case the morphism $X_{n - 1} \to Y$ is still a sequence of
contractions of exceptional curves by
Resolution of Surfaces, Lemma
\ref{resolve-lemma-proper-birational-regular-surfaces}.
Hence by induction on $n$ we conclude. (The base case $n = 0$ means
that there is a sequence of contractions
$X = Y_m \to \ldots \to Y_1 \to Y_0 = Y$
ending with $Y$. However as $X$ is a minimal model it contains
no exceptional curves of the first kind, hence $m = 0$ and $X = Y$.)

\medskip\noindent
Proof of the claim. We will show by induction on $m$ that any exceptional
curve of the first kind $E \subset Y_m$ is mapped to a point
by the morphism $Y_m \to Y$. If $m = 0$ this is clear because
$Y$ is a minimal model. If $m > 0$, then either
$Y_m \to Y_{m - 1}$ contracts $E$ (and we're done) or
the exceptional fibre $E' \subset Y_m$ of $Y_m \to Y_{m - 1}$
is a second exceptional curve of the first kind.
Since both $E$ and $E'$ are irreducible components of the special
fibre and since $g_C > 0$ by assumption, we conclude that
$E \cap E' = \emptyset$ by
Lemma \ref{lemma-exceptional-curves-dont-meet}.
Then the image of $E$ in $Y_{m - 1}$ is an exceptional
curve of the first kind (this is clear because the morphism
$Y_m \to Y_{m - 1}$ is an isomorphism in a neighbourhood of $E$).
By induction we see that $Y_{m - 1} \to Y$ contracts this curve
and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-minimal-model-mapping-property}
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$
and genus $> 0$. Let $X$ be the minimal model for $C$
(Lemma \ref{lemma-minimal-model-unique}).
Let $Y$ be a regular proper model for $C$. Then there is a unique
morphism of models $Y \to X$ which is a sequence of contractions of
exceptional curves of the first kind.
\end{lemma}

\begin{proof}
The existence and properties of the morphism $X \to Y$
follows immediately from Lemma \ref{lemma-pre-exists-minimal-model}
and the uniqueness of the minimal model.
The morphism $Y \to X$ is unique because
$C \subset Y$ is scheme theoretically dense and $X$ is separated
(see Morphisms, Lemma \ref{morphisms-lemma-equality-of-morphisms}).
\end{proof}

\begin{example}
\label{example-nonunique-in-genus-zero}
If the genus of $C$ is $0$, then minimal models are indeed nonunique.
Namely, consider the closed subscheme
$$
X \subset \mathbf{P}^2_R
$$
defined by $T_1T_2 - \pi T_0^2 = 0$. More precisely $X$ is defined
as $\text{Proj}(R[T_0, T_1, T_2]/(T_1T_2 - \pi T_0^2))$. Then the
special fibre $X_k$ is a union of two exceptional curves $C_1$, $C_2$ both
isomorphic to $\mathbf{P}^1_k$
(exactly as in Lemma \ref{lemma-exceptional-curves-dont-meet}).
Projection from $(0 : 1 : 0)$ defines a morphism $X \to \mathbf{P}^1_R$
contracting $C_2$ and inducing an isomorphism of $C_1$ with the special
fiber of $\mathbf{P}^1_R$. Projection from $(0 : 0 : 1)$ defines a
morphism $X \to \mathbf{P}^1_R$ contracting $C_1$ and inducing an
isomorphism of $C_2$ with the special fiber of $\mathbf{P}^1_R$.
More precisely, these morphisms correspond to the graded $R$-algebra
maps
$$
R[T_0, T_1] \longrightarrow
R[T_0, T_1, T_2]/(T_1T_2 - \pi T_0^2) \longleftarrow
R[T_0, T_2]
$$
In Lemma \ref{lemma-nonuniqueness} we will study this phenomenon.
\end{example}








\section{A formula for the genus}
\label{section-genus-formula}

\noindent
There is one more restriction on the combinatorial structure
coming from a proper regular model.

\begin{lemma}
\label{lemma-add-component}
In Situation \ref{situation-regular-model} suppose we have an
effective Cartier divisors $D, D' \subset X$ such that
$D' = D + C_i$ for some $i \in \{1, \ldots, n\}$ and $D' \subset X_k$.
Then
$$
\chi(X_k, \mathcal{O}_{D'}) - \chi(X_k, \mathcal{O}_D) =
\chi(X_k, \mathcal{O}_X(-D)|_{C_i}) =
-(D \cdot C_i) + \chi(C_i, \mathcal{O}_{C_i})
$$
\end{lemma}

\begin{proof}
The second equality follows from the definition of the bilinear form
$(\ \cdot\ )$ in (\ref{equation-form}) and
Lemma \ref{lemma-intersection-pairing}. To see the first
equality we distinguish two cases.
Namely, if $C_i \not \subset D$, then $D'$ is the scheme
theoretic union of $D$ and $C_i$ (by
Divisors, Lemma \ref{divisors-lemma-sum-effective-Cartier-divisors-union})
and we get a short exact sequence
$$
0 \to \mathcal{O}_{D'} \to
\mathcal{O}_D \times \mathcal{O}_{C_i} \to
\mathcal{O}_{D \cap C_i} \to 0
$$
by Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-union}.
Since we also have an exact sequence
$$
0 \to \mathcal{O}_X(-D)|_{C_i} \to
\mathcal{O}_{C_i} \to \mathcal{O}_{D \cap C_i} \to 0
$$
(Divisors, Remark \ref{divisors-remark-ses-regular-section})
we conclude that the claim holds
by additivity of euler characteristics
(Varieties, Lemma \ref{varieties-lemma-euler-characteristic-additive}).
On the other hand, if $C_i \subset D$ then we get an
exact sequence
$$
0 \to \mathcal{O}_X(-D)|_{C_i} \to \mathcal{O}_{D'} \to \mathcal{O}_D \to 0
$$
by Divisors, Lemma \ref{divisors-lemma-ses-add-divisor}
and we immediately see the lemma holds.
\end{proof}

\begin{lemma}
\label{lemma-genus-formula}
In Situation \ref{situation-regular-model} we have
$$
g_C = 1 + \sum\nolimits_{i = 1, \ldots, n}
m_i\left([\kappa_i : k] (g_i - 1) - \frac{1}{2}(C_i \cdot C_i)\right)
$$
where $\kappa_i = H^0(C_i, \mathcal{O}_{C_i})$,
$g_i$ is the genus of $C_i$, and $g_C$ is the genus of $C$.
\end{lemma}

\begin{proof}
Our basic tool will be Derived Categories of Schemes, Lemma
\ref{perfect-lemma-chi-locally-constant-geometric}
which shows that
$$
1 - g_C = \chi(C, \mathcal{O}_C) =
\chi(X_k, \mathcal{O}_{X_k})
$$
Choose a sequence of effective Cartier divisors
$$
X_k = D_m \supset D_{m - 1} \supset \ldots \supset D_1 \supset D_0 = \emptyset
$$
such that $D_{j + 1} = D_j + C_{i_j}$ for each $j$. (It is clear that
we can choose such a sequence by decreasing one nonzero multiplicity
of $D_{j + 1}$ one step at a time.) Applying Lemma \ref{lemma-add-component}
starting with $\chi(\mathcal{O}_{D_0}) = 0$ we get
\begin{align*}
1 - g_C
& =
\chi(X_k, \mathcal{O}_{X_k}) \\
& =
\sum\nolimits_j
\left(-(D_j \cdot C_{i_j}) +  \chi(C_{i_j}, \mathcal{O}_{C_{i_j}})\right) \\
& =
- \sum\nolimits_j
(C_{i_1} + C_{i_2} + \ldots + C_{i_{j - 1}} \cdot C_{i_j}) +
\sum\nolimits_j \chi(C_{i_j}, \mathcal{O}_{C_{i_j}}) \\
& =
-\frac{1}{2}\sum\nolimits_{j \not = j'} (C_{i_{j'}} \cdot C_{i_j}) +
\sum m_i \chi(C_i, \mathcal{O}_{C_i}) \\
& =
\frac{1}{2} \sum m_i(C_i \cdot C_i) + \sum m_i \chi(C_i, \mathcal{O}_{C_i})
\end{align*}
Perhaps the last equality deserves some explanation. Namely, since
$\sum_j C_{i_j} = \sum m_i C_i$ we have
$(\sum_j C_{i_j} \cdot \sum_j C_{i_j}) = 0$ by
Lemma \ref{lemma-properties-form}. Thus we see that
$$
0 = \sum\nolimits_{j \not = j'} (C_{i_{j'}} \cdot C_{i_j}) +
\sum m_i(C_i \cdot C_i)
$$
by splitting this product into ``nondiagonal'' and ``diagonal'' terms.
Note that $\kappa_i$ is a field finite over $k$ by
Varieties, Lemma \ref{varieties-lemma-regular-functions-proper-variety}.
Hence the genus of $C_i$ is defined and we have
$\chi(C_i, \mathcal{O}_{C_i}) = [\kappa_i : k](1 - g_i)$.
Putting everything together and rearranging terms we get
$$
g_C = - \frac{1}{2}\sum m_i(C_i \cdot C_i) +
\sum m_i[\kappa_i : k](g_i - 1) + 1
$$
which is what the lemma says too.
\end{proof}

\begin{lemma}
\label{lemma-numerical-type-of-model}
In Situation \ref{situation-regular-model} with
$\kappa_i = H^0(C_i, \mathcal{O}_{C_i})$ and $g_i$ the genus of $C_i$
the data
$$
n, m_i, (C_i \cdot C_j), [\kappa_i : k], g_i
$$
is a numerical type of genus equal to the genus of $C$.
\end{lemma}

\begin{proof}
(In the proof of Lemma \ref{lemma-genus-formula}
we have seen that the quantities
used in the statement of the lemma are well defined.)
We have to verify the conditions (1) -- (5) of
Definition \ref{definition-type}.

\medskip\noindent
Condition (1) is immediate.

\medskip\noindent
Condition (2). Symmetry of the matrix $(C_i \cdot C_j)$ follows from
Equation (\ref{equation-form}) and
Lemma \ref{lemma-intersection-pairing}.
Nonnegativity of $(C_i \cdot C_j)$ for $i \not = j$
is part (1) of Lemma \ref{lemma-properties-form}.

\medskip\noindent
Condition (3) is part (3) of Lemma \ref{lemma-properties-form}.

\medskip\noindent
Condition (4) is part (2) of Lemma \ref{lemma-properties-form}.

\medskip\noindent
Condition (5) follows from the fact that $(C_i \cdot C_j)$ is
the degree of an invertible module on $C_i$ which is divisible
by $[\kappa_i : k]$, see Varieties, Lemma \ref{varieties-lemma-divisible}.

\medskip\noindent
The genus formula proved in Lemma \ref{lemma-genus-formula}
tells us that the numerical type has the genus as stated, see
Definition \ref{definition-genus}.
\end{proof}

\begin{definition}
\label{definition-numerical-type-model}
In Situation \ref{situation-regular-model} the
{\it numerical type associated to $X$} is the numerical
type described in Lemma \ref{lemma-numerical-type-of-model}.
\end{definition}

\noindent
Now we match minimality of the model with minimality of the type.

\begin{lemma}
\label{lemma-numerical-type-minimal-model}
In Situation \ref{situation-regular-model}. The following
are equivalent
\begin{enumerate}
\item $X$ is a minimal model, and
\item the numerical type associated to $X$ is minimal.
\end{enumerate}
\end{lemma}

\begin{proof}
If the numerical type is minimal, then there is no $i$ with
$g_i = 0$ and $(C_i \cdot C_i) = -[\kappa_i: k]$, see
Definition \ref{definition-type-minimal}.
Certainly, this implies that none of the curves $C_i$
are exceptional curves of the first kind.

\medskip\noindent
Conversely, suppose that the numerical type is not minimal.
Then there exists an $i$ such that $g_i = 0$ and
$(C_i \cdot C_i) = -[\kappa_i: k]$.
We claim this implies that $C_i$ is an exceptional curve
of the first kind. Namely, the invertible sheaf
$\mathcal{O}_X(-C_i)|_{C_i}$ has degree $-(C_i \cdot C_i) = [\kappa_i : k]$
when $C_i$ is viewed as a proper curve over $k$, hence
has degree $1$ when $C_i$ is viewed as a proper curve over $\kappa_i$.
Applying
Algebraic Curves, Proposition \ref{curves-proposition-projective-line}
we conclude that $C_i \cong \mathbf{P}^1_{\kappa_i}$ as schemes
over $\kappa_i$. Since the Picard group of $\mathbf{P}^1$
over a field is $\mathbf{Z}$, we see that the normal sheaf
of $C_i$ in $X$ is isomorphic to $\mathcal{O}_{\mathbf{P}_{\kappa_i}}(-1)$
and the proof is complete.
\end{proof}

\begin{remark}
\label{remark-numerical-type-not-from-model}
Not every numerical type comes from a model for the silly reason
that there exist numerical types whose genus is negative.
There exist a minimal numerical types of positive genus which
are not the numerical type associated to a model (over some dvr)
of a smooth projective geometrically irreducible curve (over the
fraction field of the dvr). A simple example is
$n = 1$, $m_1 = 1$, $a_{11} = 0$, $w_1 = 6$, $g_1 = 1$.
Namely, in this case the special fibre $X_k$ would not be
geometrically connected because it would live over an extension
$\kappa$ of $k$ of degree $6$. This is a contradiction with the
fact that the generic fibre is geometrically connected (see
More on Morphisms, Lemma
\ref{more-morphisms-lemma-geometrically-connected-fibres-towards-normal}).
Similarly, $n = 2$, $m_1 = m_2 = 1$, $-a_{11} = -a_{22} = a_{12} = a_{21} = 6$,
$w_1 = w_2 = 6$, $g_1 = g_2 = 1$ would be an example
for the same reason (details omitted). But if the gcd of
the $w_i$ is $1$ we do not have an example.
\end{remark}

\begin{lemma}
\label{lemma-numerical-type-rational-point}
In Situation \ref{situation-regular-model} assume $C$ has a $K$-rational point.
Then
\begin{enumerate}
\item $X_k$ has a $k$-rational point $x$ which is a smooth point of $X_k$
over $k$,
\item if $x \in C_i$, then $H^0(C_i, \mathcal{O}_{C_i}) = k$ and
$m_i = 1$, and
\item $H^0(X_k, \mathcal{O}_{X_k}) = k$ and $X_k$ has genus equal to
the genus of $C$.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $X \to \Spec(R)$ is proper, the $K$-rational point extends to
a morphism $a : \Spec(R) \to X$ by the valuative criterion of properness
(Morphisms, Lemma \ref{morphisms-lemma-characterize-proper}).
Let $x \in X$ be the image under $a$ of the closed point of $\Spec(R)$.
Then $a$ corresponds to an $R$-algebra homomorphism
$\psi : \mathcal{O}_{X, x} \to R$
(see Schemes, Section \ref{schemes-section-points}).
It follows that $\pi \not \in \mathfrak m_x^2$ (since the image
of $\pi$ in $R$ is not in $\mathfrak m_R^2$).
Hence $\mathcal{O}_{X_k, x} = \mathcal{O}_{X, x}/\pi \mathcal{O}_{X, x}$
is regular (Algebra, Lemma \ref{algebra-lemma-regular-ring-CM}).
Then $X_k \to \Spec(k)$ is smooth at $x$ by
Algebra, Lemma \ref{algebra-lemma-separable-smooth}.
It follows that $x$ is contained in a unique irreducible component
$C_i$ of $X_k$, that $\mathcal{O}_{C_i, x} = \mathcal{O}_{X_k, x}$,
and that $m_i = 1$. The fact that $C_i$ has a
$k$-rational point implies that the field
$\kappa_i = H^0(C_i, \mathcal{O}_{C_i})$
(Varieties, Lemma \ref{varieties-lemma-regular-functions-proper-variety})
is equal to $k$. This proves (1). We have
$H^0(X_k, \mathcal{O}_{X_k}) = k$
because $H^0(X_k, \mathcal{O}_{X_k})$ is a field
extension of $k$ (Lemma \ref{lemma-regular-model-field})
which maps to $H^0(C_i, \mathcal{O}_{C_i}) = k$.
The genus equality follows from Lemma \ref{lemma-regular-model-genus}.
\end{proof}

\begin{lemma}
\label{lemma-genus-reduction-smaller}
In Situation \ref{situation-regular-model} assume $X$ is a minimal model,
$\gcd(m_1, \ldots, m_n) = 1$, and $H^0((X_k)_{red}, \mathcal{O}) = k$. Then
the map
$$
H^1(X_k, \mathcal{O}_{X_k}) \to H^1((X_k)_{red}, \mathcal{O}_{(X_k)_{red}})
$$
is surjective and has a nontrivial kernel as soon as $(X_k)_{red} \not = X_k$.
\end{lemma}

\begin{proof}
By vanishing of cohomology in degrees $\geq 2$ over $X_k$
(Cohomology, Proposition \ref{cohomology-proposition-vanishing-Noetherian})
any surjection of abelian sheaves on $X_k$ induces a surjection on $H^1$.
Consider the sequence
$$
(X_k)_{red} = Z_0 \subset Z_1 \subset \ldots \subset Z_m = X_k
$$
of Lemma \ref{lemma-regular-model-field}. Since the field maps
$H^0(Z_j, \mathcal{O}_{Z_j}) \to
H^0((X_k)_{red}, \mathcal{O}_{(X_k)_{red}}) = k$
are injective we conclude that $H^0(Z_j, \mathcal{O}_{Z_j}) = k$ for
$j = 0, \ldots, m$. It follows that
$H^0(X_k, \mathcal{O}_{X_k}) \to H^0(Z_{m - 1}, \mathcal{O}_{Z_{m - 1}})$
is surjective. Let $C = C_{i_m}$. Then $X_k = Z_{m - 1} + C$.
Let $\mathcal{L} = \mathcal{O}_X(-Z_{m - 1})|_C$.
Then $\mathcal{L}$ is an invertible $\mathcal{O}_C$-module.
As in the proof of Lemma \ref{lemma-regular-model-field}
there is an exact sequence
$$
0 \to \mathcal{L} \to \mathcal{O}_{X_k} \to \mathcal{O}_{Z_{m - 1}} \to 0
$$
of coherent sheaves on $X_k$. We conclude that
we get a short exact sequence
$$
0 \to
H^1(C, \mathcal{L}) \to H^1(X_k, \mathcal{O}_{X_k}) \to
H^1(Z_{m - 1}, \mathcal{O}_{Z_{m - 1}}) \to 0
$$
The degree of $\mathcal{L}$ on $C$ over $k$ is
$$
(C \cdot -Z_{m - 1}) = (C \cdot C - X_k) = (C \cdot C)
$$
Set $\kappa = H^0(C, \mathcal{O}_C)$ and $w = [\kappa : k]$.
By definition of the degree of an invertible sheaf we see that
$$
\chi(C, \mathcal{L}) =
\chi(C, \mathcal{O}_C) + (C \cdot C) =
w(1 - g_C) + (C \cdot C)
$$
where $g_C$ is the genus of $C$. This expression is $< 0$ as $X$ is minimal
and hence $C$ is not an exceptional curve of the first kind
(see proof of Lemma \ref{lemma-numerical-type-minimal-model}).
Thus $\dim_k H^1(C, \mathcal{L}) > 0$ which finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-genus-reduction-bigger-than}
In Situation \ref{situation-regular-model} assume $X_k$ has a $k$-rational
point $x$ which is a smooth point of $X_k \to \Spec(k)$. Then
$$
\dim_k H^1((X_k)_{red}, \mathcal{O}_{(X_k)_{red}}) \geq
g_{top} + g_{geom}(X_k/k)
$$
where $g_{geom}$ is as in
Algebraic Curves, Section \ref{curves-section-genus-geometric-genus}
and $g_{top}$ is the topological genus
(Definition \ref{definition-top-genus})
of the numerical type associated to $X_k$
(Definition \ref{definition-numerical-type-model}).
\end{lemma}

\begin{proof}
We are going to prove the inequality
$$
\dim_k H^1(D, \mathcal{O}_D) \geq g_{top}(D) + g_{geom}(D/k)
$$
for all connected reduced effective Cartier divisors
$D \subset (X_k)_{red}$ containing $x$ by induction
on the number of irreducible components of $D$.
Here $g_{top}(D) = 1 - m + e$ where $m$ is the number of
irreducible components of $D$ and $e$ is the number of
unordered pairs of components of $D$ which meet.

\medskip\noindent
Base case: $D$ has one irreducible component. Then $D = C_i$
is the unique irreducible component containing $x$.
In this case $\dim_k H^1(D, \mathcal{O}_D) = g_i$
and $g_{top}(D) = 0$. Since $C_i$ has a $k$-rational smooth point
it is geometrically integral
(Varieties, Lemma \ref{varieties-lemma-variety-with-smooth-rational-point}).
It follows that $g_i$ is the genus of $C_{i, \overline{k}}$
(Algebraic Curves, Lemma \ref{curves-lemma-genus-base-change}).
It also follows that $g_{geom}(D/k)$ is the genus of the normalization
$C_{i, \overline{k}}^\nu$ of $C_{i, \overline{k}}$. Applying
Algebraic Curves, Lemma \ref{curves-lemma-genus-normalization}
to the normalization morphism $C_{i, \overline{k}}^\nu \to C_{i, \overline{k}}$
we get
\begin{equation}
\label{equation-genus-change-special-component}
\text{genus of }C_{i, \overline{k}} \geq
\text{genus of }C_{i, \overline{k}}^\nu
\end{equation}
Combining the above we conclude that
$\dim_k H^1(D, \mathcal{O}_D) \geq g_{top}(D) + g_{geom}(D/k)$
in this case.

\medskip\noindent
Induction step. Suppose we have $D$ with more than $1$ irreducible
component. Then we can write $D = C_i + D'$ where $x \in D'$ and
$D'$ is still connected. This is an exercise in graph theory we leave
to the reader (hint: let $C_i$ be the component of $D$ which is
farthest from $x$). We compute how the invariants change.
As $x \in D'$ we have $H^0(D, \mathcal{O}_D) = H^0(D', \mathcal{O}_{D'}) = k$.
Looking at the short exact sequence of sheaves
$$
0 \to \mathcal{O}_D \to \mathcal{O}_{C_i} \oplus \mathcal{O}_{D'}
\to \mathcal{O}_{C_i \cap D'} \to 0
$$
(Morphisms, Lemma \ref{morphisms-lemma-scheme-theoretic-union})
and using additivity of euler characteristics we find
\begin{align*}
\dim_k H^1(D, \mathcal{O}_D) - \dim_k H^1(D', \mathcal{O}_{D'})
& =
-\chi(\mathcal{O}_{C_i}) + \chi(\mathcal{O}_{C_i \cap D'}) \\
& =
w_i(g_i - 1) + \sum\nolimits_{C_j \subset D'} a_{ij}
\end{align*}
Here as in Lemma \ref{lemma-numerical-type-of-model} we set
$w_i = [\kappa_i : k]$, $\kappa_i = H^0(C_i, \mathcal{O}_{C_i})$,
$g_i$ is the genus of $C_i$, and $a_{ij} = (C_i \cdot C_j)$.
We have
$$
g_{top}(D) - g_{top}(D') = -1 +
\sum\nolimits_{C_j \subset D'\text{ meeting }C_i} 1
$$
We have
$$
g_{geom}(D/k) - g_{geom}(D'/k) = g_{geom}(C_i/k)
$$
by Algebraic Curves, Lemma \ref{curves-lemma-bound-geometric-genus}.
Combining these with our induction hypothesis, we
conclude that it suffices to show that
$$
w_i g_i - g_{geom}(C_i/k) +
\sum\nolimits_{C_j \subset D'\text{ meets } C_i} (a_{ij} - 1) - (w_i - 1)
$$
is nonnegative. In fact, we have
\begin{equation}
\label{equation-genus-change}
w_i g_i \geq [\kappa_i : k]_s g_i \geq g_{geom}(C_i/k)
\end{equation}
The second inequality by
Algebraic Curves, Lemma \ref{curves-lemma-bound-geometric-genus-curve}.
On the other hand, since $w_i$ divides $a_{ij}$
(Varieties, Lemma \ref{varieties-lemma-divisible})
it is clear that
\begin{equation}
\label{equation-change-intersections}
\sum\nolimits_{C_j \subset D'\text{ meets } C_i} (a_{ij} - 1) - (w_i - 1)
\geq 0
\end{equation}
because there is at least one $C_j \subset D'$ which meets $C_i$.
\end{proof}

\begin{lemma}
\label{lemma-equality-genus-reduction-bigger-than}
If equality holds in Lemma \ref{lemma-genus-reduction-bigger-than}
then
\begin{enumerate}
\item the unique irreducible component of $X_k$ containing
$x$ is a smooth projective geometrically irreducible curve
over $k$,
\item if $C \subset X_k$ is another irreducible component, then
$\kappa = H^0(C, \mathcal{O}_C)$ is a finite separable extension
of $k$, $C$ has a $\kappa$-rational point, and $C$ is smooth over $\kappa$
\end{enumerate}
\end{lemma}

\begin{proof}
Looking over the proof of Lemma \ref{lemma-genus-reduction-bigger-than}
we see that in order to get equality, the inequalities
(\ref{equation-genus-change-special-component}),
(\ref{equation-genus-change}), and
(\ref{equation-change-intersections})
have to be equalities.

\medskip\noindent
Let $C_i$ be the irreducible component containing $x$.
Equality in (\ref{equation-genus-change-special-component})
shows via
Algebraic Curves, Lemma \ref{curves-lemma-genus-normalization}
that $C_{i, \overline{k}}^\nu \to C_{i, \overline{k}}$ is
an isomorphism. Hence $C_{i, \overline{k}}$ is smooth
and part (1) holds.

\medskip\noindent
Next, let $C_i \subset X_k$ be another irreducible component.
Then we may assume we have $D =  D' + C_i$ as in the induction step
in the proof of Lemma \ref{lemma-genus-reduction-bigger-than}.
Equality in (\ref{equation-genus-change}) immediately implies
that $\kappa_i/k$ is finite separable.
Equality in (\ref{equation-change-intersections})
implies either $a_{ij} = 1$ for some $j$ or that there is a
unique $C_j \subset D'$ meeting $C_i$ and $a_{ij} = w_i$.
In both cases we find that $C_i$ has a $\kappa_i$-rational point
$c$ and $c = C_i \cap C_j$ scheme theoretically.
Since $\mathcal{O}_{X, c}$ is a regular local ring,
this implies that the local equations of $C_i$ and $C_j$
form a regular system of parameters in the local ring $\mathcal{O}_{X, c}$.
Then $\mathcal{O}_{C_i, c}$ is regular by
(Algebra, Lemma \ref{algebra-lemma-regular-ring-CM}).
We conclude that $C_i \to \Spec(\kappa_i)$ is smooth at $c$
(Algebra, Lemma \ref{algebra-lemma-separable-smooth}).
It follows that $C_i$ is geometrically integral over $\kappa_i$
(Varieties, Lemma \ref{varieties-lemma-variety-with-smooth-rational-point}).
To finish we have to show that $C_i$ is smooth over $\kappa_i$. Observe that
$$
C_{i, \overline{k}} = C_i \times_{\Spec(k)} \Spec(\overline{k})
= \coprod\nolimits_{\kappa_i \to \overline{k}}
C_i \times_{\Spec(\kappa_i)} \Spec(\overline{k})
$$
where there are $[\kappa_i : k]$-summands. Thus if $C_i$ is not
smooth over $\kappa_i$, then each of these curves is not smooth, then
these curves are not normal and the normalization morphism drops the genus
(Algebraic Curves, Lemma \ref{curves-lemma-genus-normalization})
which is disallowed because it would drop the geometric genus
of $C_i/k$ contradicting $[\kappa_i : k] g_i = g_{geom}(C_i/k)$.
\end{proof}








\section{Blowing down exceptional curves}
\label{section-contract}

\noindent
The following lemma tells us what happens with the intersection
numbers when we contract an exceptional curve of the first kind
in a regular proper model. We put this here mostly to compare with
the numerical contractions introduced in Lemma \ref{lemma-contract}.
We will compare the geometric and numerical contractions in
Remark \ref{remark-compare-contractions}.

\begin{lemma}
\label{lemma-blowdown-regular-model}
In Situation \ref{situation-regular-model} assume that $C_n$ is
an exceptional curve of the first kind. Let $f : X \to X'$ be the
contraction of $C_n$. Let $C'_i = f(C_i)$. Write $X'_k = \sum m'_i C'_i$.
Then $X'$, $C'_i$, $i = 1, \ldots, n' = n - 1$, and $m'_i = m_i$
is as in Situation \ref{situation-regular-model} and we have
\begin{enumerate}
\item for $i, j < n$ we have
$(C'_i \cdot C'_j) =
(C_i \cdot C_j) - (C_i \cdot C_n) (C_j \cdot C_n) /(C_n \cdot C_n)$,
\item for $i < n$ if $C_i \cap C_n \not = \emptyset$, then there are
maps $\kappa_i \leftarrow \kappa'_i \rightarrow \kappa_n$.
\end{enumerate}
Here $\kappa_i = H^0(C_i, \mathcal{O}_{C_i})$ and
$\kappa'_i = H^0(C'_i, \mathcal{O}_{C'_i})$.
\end{lemma}

\begin{proof}
By Resolution of Surfaces, Lemma \ref{resolve-lemma-contract-ample}
we can contract $C_n$ by a morphism $f : X \to X'$ such that $X'$ is
regular and is projective over $R$. Thus we see that $X'$ is as in
Situation \ref{situation-regular-model}.
Let $x \in X'$ be the image of $C_n$.
Since $f$ defines an isomorphism $X \setminus C_n \to X' \setminus \{x\}$
it is clear that $m'_i = m_i$ for $i < n$.

\medskip\noindent
Part (2) of the lemma is immediately clear from
the existence of the morphisms $C_i \to C'_i$ and $C_n \to x \to C'_i$.

\medskip\noindent
By Divisors, Lemma \ref{divisors-lemma-blow-up-pullback-effective-Cartier}
the pullback $f^{-1}C'_i$ is defined. By
Divisors, Lemma \ref{divisors-lemma-effective-Cartier-divisor-is-a-sum}
we see that $f^{-1}C'_i = C_i + e_i C_n$ for some $e_i \geq 0$. Since
$\mathcal{O}_X(C_i + e_i C_n) = \mathcal{O}_X(f^{-1}C'_i) =
f^*\mathcal{O}_{X'}(C'_i)$
(Divisors, Lemma \ref{divisors-lemma-pullback-effective-Cartier-divisors})
and since the pullback of an invertible sheaf restricts to the
trivial invertible sheaf on $C_n$ we see that
$$
0 = \deg_{C_n}(\mathcal{O}_X(C_i + e_i C_n)) =
(C_i + e_i C_n \cdot C_n) = (C_i \cdot C_n) + e_i(C_n \cdot C_n)
$$
As $f_j = f|_{C_j} : C_j \to C_j$ is a
proper birational morphism of proper curves
over $k$, we see that $\deg_{C'_j}(\mathcal{O}_{X'}(C'_i)|_{C'_j})$ is the
same as $\deg_{C_j}(f_j^*\mathcal{O}_{X'}(C'_i)|_{C'_j})$
(Varieties, Lemma \ref{varieties-lemma-degree-birational-pullback}).
Looking at the commutative diagram
$$
\xymatrix{
C_j \ar[r] \ar[d]_{f_j} & X \ar[d]^f \\
C'_j \ar[r] & X'
}
$$
and using Divisors, Lemma
\ref{divisors-lemma-pullback-effective-Cartier-divisors}
we see that
$$
(C'_i \cdot C'_j) = \deg_{C'_j}(\mathcal{O}_{X'}(C'_i)|_{C'_j}) =
\deg_{C_j}(\mathcal{O}_X(C_i + e_i C_n)) = (C_i + e_i C_n \cdot C_j)
$$
Plugging in the formula for $e_i$ found above we see that (1) holds.
\end{proof}

\begin{remark}
\label{remark-genus-change}
In the situation of Lemma \ref{lemma-blowdown-regular-model}
we can also say exactly how the genus $g_i$ of $C_i$ and the genus
$g'_i$ of $C'_i$ are related. The formula is
$$
g'_i = \frac{w_i}{w'_i}(g_i - 1) + 1 +
\frac{(C_i \cdot C_n)^2 - w_n(C_i \cdot C_n)}{2w'_iw_n}
$$
where $w_i = [\kappa_i : k]$, $w_n = [\kappa_n : k]$, and
$w'_i = [\kappa'_i : k]$.
To prove this we consider the short exact sequence
$$
0 \to \mathcal{O}_{X'}(-C'_i) \to \mathcal{O}_{X'} \to
\mathcal{O}_{C'_i} \to 0
$$
and its pullback to $X$ which reads
$$
0 \to \mathcal{O}_X(-C'_i - e_iC_n) \to \mathcal{O}_X \to
\mathcal{O}_{C_i + e_i C_n} \to 0
$$
with $e_i$ as in the proof of Lemma \ref{lemma-blowdown-regular-model}.
Since $Rf_*f^*\mathcal{L} = \mathcal{L}$ for any invertible module
$\mathcal{L}$ on $X'$ (details omitted), we conclude that
$$
Rf_*\mathcal{O}_{C_i + e_i C_n} = \mathcal{O}_{C'_i}
$$
as complexes of coherent sheaves on $X'_k$.
Hence both sides have the same Euler characteristic and this
agrees with the Euler characteristic of $\mathcal{O}_{C_i + e_i C_n}$
on $X_k$. Using the exact sequence
$$
0 \to \mathcal{O}_{C_i + e_i C_n} \to
\mathcal{O}_{C_i} \oplus \mathcal{O}_{e_iC_n} \to
\mathcal{O}_{C_i \cap e_iC_n} \to 0
$$
and further filtering $\mathcal{O}_{e_iC_n}$ (details omitted) we find
$$
\chi(\mathcal{O}_{C'_i}) =
\chi(\mathcal{O}_{C_i}) - {e_i + 1 \choose 2}(C_n \cdot C_n)
- e_i(C_i \cdot C_n)
$$
Since $e_i = -(C_i \cdot C_n)/(C_n \cdot C_n)$ and
$(C_n \cdot C_n) = -w_n$ this leads to the formula
stated at the start of this remark. If we ever need
this we will formulate this as a lemma and
provide a detailed proof.
\end{remark}

\begin{remark}
\label{remark-compare-contractions}
Let $f : X \to X'$ be as in Lemma \ref{lemma-blowdown-regular-model}.
Let $n, m_i, a_{ij}, w_i, g_i$ be the numerical type associated to $X$ and
let $n', m'_i, a'_{ij}, w'_i, g'_i$ be the numerical type associated to $X'$.
It is clear from Lemma \ref{lemma-blowdown-regular-model} and
Remark \ref{remark-genus-change}
that this agrees with the contraction of numerical types in
Lemma \ref{lemma-contract}
except for the value of $w'_i$.
In the geometric situation $w'_i$ is some positive integer
dividing both $w_i$ and $w_n$. In the numerical case
we chose $w'_i$ to be the largest possible integer dividing
$w_i$ such that $g'_i$ (as given by the formula) is an integer.
This works well in the numerical setting
in that it helps compare the Picard groups
of the numerical types, see Lemma \ref{lemma-contract-picard-group}
(although only injectivity is every used in the following and this
injectivity works as well for smaller $w'_i$).
\end{remark}

\begin{lemma}
\label{lemma-nonuniqueness}
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$
and genus $0$. If there is more than one minimal model for $C$, then
the special fibre of every minimal model is isomorphic to $\mathbf{P}^1_k$.
\end{lemma}

\noindent
This lemma can be improved to say that the birational transformation
between two nonisomorphic minimal models can be factored as a sequence of
elementary transformations as in Example \ref{example-nonunique-in-genus-zero}.
If we ever need this, we will precisely formulate and prove this here.

\begin{proof}
Let $X$ be some minimal model of $C$. The numerical type associated to $X$
has genus $0$ and is minimal (Definition \ref{definition-numerical-type-model}
and Lemma \ref{lemma-numerical-type-minimal-model}).
Hence by Lemma \ref{lemma-genus-zero} we see that
$X_k$ is reduced, irreducible, has $H^0(X_k, \mathcal{O}_{X_k}) = k$,
and has genus $0$. Let $Y$ be a second minimal model for $C$
which is not isomorphic to $X$. By
Resolution of Surfaces, Lemma \ref{resolve-lemma-birational-regular-surfaces}
there exists a diagram of $S$-morphisms
$$
X = X_0 \leftarrow X_1 \leftarrow \ldots \leftarrow X_n = Y_m
\to \ldots \to Y_1 \to Y_0 = Y
$$
where each morphism is a blowup in a closed point. We will prove the
lemma by induction on $m$. The base case is $m = 0$; it is
true in this case because we assumed that $Y$ is minimal
hence this would mean $n = 0$, but $X$ is not isomorphic
to $Y$, so this does not happen, i.e., there is nothing to check.

\medskip\noindent
Before we continue, note that $n + 1 = m + 1$ is equal to the number of
irreducible components of the special fibre of $X_n = Y_m$ because
both $X_k$ and $Y_k$ are irreducible. Another observation we
will use below is that if $X' \to X''$ is a morphism
of regular proper models for $C$, then $X' \to X''$ is an isomorphism
over an open set of $X''$ whose complement is a finite set
of closed points of the special fibre of $X''$, see
Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}.
In fact, any such $X' \to X''$ is a sequence
of blowing ups in closed points (Resolution of Surfaces, Lemma
\ref{resolve-lemma-proper-birational-regular-surfaces}) and the
number of blowups is the difference in the number of irreducible
components of the special fibres of $X'$ and $X''$.

\medskip\noindent
Let $E_i \subset Y_i$, $m \geq i \geq 1$ be the curve which is contracted
by the morphism $Y_i \to Y_{i - 1}$. Let $i$ be the biggest index such
that $E_i$ has multiplicity $> 1$ in the special fibre of $Y_i$.
Then the further blowups $Y_m \to \ldots \to Y_{i + 1} \to Y_i$
are isomorphisms over $E_i$ since otherwise $E_j$ for some $j > i$
would have multiplicity $> 1$. Let $E \subset Y_m$ be the inverse
image of $E_i$. By what we just said $E \subset Y_m$ is an
exceptional curve of the first kind. Let $Y_m \to Y'$ be the
contraction of $E$ (which exists by Resolution of Surfaces, Lemma
\ref{resolve-lemma-contract-when-quasi-projective}). The morphism
$Y_m \to X$ has to contract $E$, because $X_k$ is reduced.
Hence there are morphisms $Y' \to Y$ and $Y' \to X$ (by
Resolution of Surfaces, Lemma
\ref{resolve-lemma-factor-through-contraction})
which are compositions of at most $n - 1 = m - 1$ contractions
of exceptional curves (see discussion above). We win by induction on $m$.
Upshot: we may assume that the special fibres of all of
the curves $X_i$ and $Y_i$ are reduced.

\medskip\noindent
Since the fibres of $X_i$ and $Y_i$ are reduced, it has to be the
case that the blowups $X_i \to X_{i - 1}$ and $Y_i \to Y_{i - 1}$
happen in closed points which are regular points of the special fibres.
Namely, if $X''$ is a regular model for $C$ and if $x \in X''$
is a closed point of the special fibre, and
$\pi \in \mathfrak m_x^2$, then the exceptional fibre $E$ of the
blowup $X' \to X''$ at $x$ has multiplicity at least $2$ in the
special fibre of $X'$ (local computation omitted).
Hence $\mathcal{O}_{X''_k, x} = \mathcal{O}_{X'', x}/\pi$ is
regular (Algebra, Lemma \ref{algebra-lemma-regular-ring-CM}) as claimed.
In particular $x$ is a Cartier divisor on the unique
irreducible component $Z'$ of $X''_k$ it lies on
(Varieties, Lemma \ref{varieties-lemma-regular-point-on-curve}).
It follows that the strict transform $Z \subset X'$ of $Z'$
maps isomorphically to $Z'$
(use Divisors, Lemmas \ref{divisors-lemma-strict-transform} and
\ref{divisors-lemma-blow-up-effective-Cartier-divisor}).
In other words, if an irreducible component $Z$ of $X_i$
is not contracted under the map $X_i \to X_j$ ($i > j$)
then it maps isomorphically to its image.

\medskip\noindent
Now we are ready to prove the lemma.
Let $E \subset Y_m$ be the exceptional curve of the first kind
which is contracted by the morphism $Y_m \to Y_{m - 1}$. If $E$ is
contracted by the morphism $Y_m = X_n \to X$, then there is a factorization
$Y_{m - 1} \to X$ (Resolution of Surfaces, Lemma
\ref{resolve-lemma-factor-through-contraction})
and moreover $Y_{m - 1} \to X$ is a sequence of blowups
in closed points (Resolution of Surfaces, Lemma
\ref{resolve-lemma-proper-birational-regular-surfaces}).
In this case we lower $m$ and we win by induction.
Finally, assume that $E$ is not contracted by the morphism $Y_m \to X$.
Then $E \to X_k$ is surjective as $X_k$ is irreducible
and by the above this means it is an isomorphism.
Hence $X_k$ is isomorphic to a projective line as desired.
\end{proof}





\section{Picard groups of models}
\label{section-picard-groups-models}

\noindent
Assume $R, K, k, \pi, C, X, n, C_1, \ldots, C_n, m_1, \ldots, m_n$
are as in Situation \ref{situation-regular-model}.
In Lemma \ref{lemma-regular-model-pic} we found an exact sequence
$$
0 \to \mathbf{Z} \to \mathbf{Z}^{\oplus n} \to
\Pic(X) \to \Pic(C) \to 0
$$
We want to use this sequence to study the $\ell$-torsion in the
Picard groups for suitable primes $\ell$.

\begin{lemma}
\label{lemma-characterize-trivial}
In Situation \ref{situation-regular-model} let $d = \gcd(m_1, \ldots, m_n)$.
If $\mathcal{L}$ is an invertible $\mathcal{O}_X$-module which
\begin{enumerate}
\item restricts to the trivial invertible module on $C$, and
\item has degree $0$ on each $C_i$,
\end{enumerate}
then $\mathcal{L}^{\otimes d} \cong \mathcal{O}_X$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-regular-model-pic} we have
$\mathcal{L} \cong \mathcal{O}_X(\sum a_i C_i)$ for some
$a_i \in \mathbf{Z}$. The degree of $\mathcal{L}|_{C_j}$
is $\sum_j a_j(C_i \cdot C_j)$. In particular
$(\sum a_i C_i \cdot \sum a_i C_i) = 0$.
Hence we see from Lemma \ref{lemma-properties-form}
that $(a_1, \ldots, a_n) = q(m_1, \ldots, m_n)$ for some
$q \in \mathbf{Q}$. Thus $\mathcal{L} = \mathcal{O}_X(lD)$
for some $l \in \mathbf{Z}$ where $D = \sum (m_i/d) C_i$ is as in
Lemma \ref{lemma-multiple-fibre-normal-bundle}
and we conclude.
\end{proof}

\begin{lemma}
\label{lemma-canonical-map-of-pic}
In Situation \ref{situation-regular-model}
let $T$ be the numerical type associated to $X$.
There exists a canonical map
$$
\Pic(C) \to \Pic(T)
$$
whose kernel is exactly those invertible modules on $C$
which are the restriction of invertible modules $\mathcal{L}$
on $X$ with $\deg_{C_i}(\mathcal{L}|_{C_i}) = 0$ for
$i = 1, \ldots, n$.
\end{lemma}

\begin{proof}
Recall that $w_i = [\kappa_i : k]$ where
$\kappa_i = H^0(C_i, \mathcal{O}_{C_i)})$ and recall
that the degree of any invertible module on $C_i$ is divisible
by $w_i$ (Varieties, Lemma \ref{varieties-lemma-divisible}).
Thus we can consider the map
$$
\frac{\deg}{w} : \Pic(X) \to \mathbf{Z}^{\oplus n}, \quad
\mathcal{L} \mapsto
(\frac{\deg(\mathcal{L}|_{C_1})}{w_1}, \ldots,
\frac{\deg(\mathcal{L}|_{C_n})}{w_n})
$$
The image of $\mathcal{O}_X(C_j)$ under this map is
$$
((C_j \cdot C_1)/w_1, \ldots, (C_j \cdot C_n)/w_n) =
(a_{1j}/w_1, \ldots, a_{nj}/w_n)
$$
which is exactly the image of the $j$th basis vector under the map
$(a_{ij}/w_i) : \mathbf{Z}^{\oplus n} \to \mathbf{Z}^{\oplus n}$
defining the Picard group of $T$, see
Definition \ref{definition-picard-group}.
Thus the canonical map of the lemma comes from the commutative
diagram
$$
\xymatrix{
\mathbf{Z}^{\oplus n} \ar[r] \ar[d]_{\text{id}} &
\Pic(X) \ar[r] \ar[d]^{\frac{\deg}{w}} &
\Pic(C) \ar[r] \ar[d] & 0 \\
\mathbf{Z}^{\oplus n} \ar[r]^{(a_{ij}/w_i)} &
\mathbf{Z}^{\oplus n} \ar[r] &
\Pic(T) \ar[r] & 0
}
$$
with exact rows (top row by Lemma \ref{lemma-regular-model-pic}).
The description of the kernel is clear.
\end{proof}

\begin{lemma}
\label{lemma-sequence-torsion}
In Situation \ref{situation-regular-model} let $d = \gcd(m_1, \ldots, m_n)$
and let $T$ be the numerical type associated to $X$.
Let $h \geq 1$ be an integer prime to $d$. There exists an exact sequence
$$
0 \to \Pic(X)[h] \to \Pic(C)[h] \to \Pic(T)[h]
$$
\end{lemma}

\begin{proof}
Taking $h$-torsion in the exact sequence of
Lemma \ref{lemma-regular-model-pic}
we obtain the exactness of
$0 \to \Pic(X)[h] \to \Pic(C)[h]$
because $h$ is prime to $d$.
Using the map Lemma \ref{lemma-characterize-trivial}
we get a map $\Pic(C)[h] \to \Pic(T)[h]$
which annihilates elements of $\Pic(X)[h]$.
Conversely, if $\xi \in \Pic(C)[h]$
maps to zero in $\Pic(T)[h]$, then we can find
an invertible $\mathcal{O}_X$-module $\mathcal{L}$
with $\deg(\mathcal{L}|_{C_i}) = 0$ for all $i$
whose restriction to $C$ is $\xi$.
Then $\mathcal{L}^{\otimes h}$ is $d$-torsion by
Lemma \ref{lemma-characterize-trivial}.
Let $d'$ be an integer such that $dd' \equiv 1 \bmod h$.
Such an integer exists because $h$ and $d$ are coprime.
Then $\mathcal{L}^{\otimes dd'}$ is an $h$-torsion
invertible sheaf on $X$ whose restriction to $C$ is $\xi$.
\end{proof}

\begin{lemma}
\label{lemma-torsion-embeds}
In Situation \ref{situation-regular-model} let $h$ be an integer
prime to the characteristic of $k$. Then the map
$$
\Pic(X)[h] \longrightarrow \Pic((X_k)_{red})[h]
$$
is injective.
\end{lemma}

\begin{proof}
Observe that $X \times_{\Spec(R)} \Spec(R/\pi^n)$ is a finite
order thickening of $(X_k)_{red}$ (this follows for example from
Cohomology of Schemes, Lemma \ref{coherent-lemma-power-ideal-kills-sheaf}).
Thus the canonical map
$\Pic(X \times_{\Spec(R)} \Spec(R/\pi^n)) \to \Pic((X_k)_{red})$
identifies $h$ torsion by
More on Morphisms, Lemma \ref{more-morphisms-lemma-torsion-pic-thickening}
and our assumption on $h$.
Thus if $\mathcal{L}$ is an $h$-torsion invertible sheaf on $X$
which restricts to the trivial sheaf on $(X_k)_{red}$ then
$\mathcal{L}$ restricts to the trivial sheaf on
$X \times_{\Spec(R)} \Spec(R/\pi^n)$ for all $n$.
We find
\begin{align*}
H^0(X, \mathcal{L})^\wedge
& =
\lim H^0(X \times_{\Spec(R)} \Spec(R/\pi^n),
\mathcal{L}|_{X \times_{\Spec(R)} \Spec(R/\pi^n)}) \\
& \cong
\lim H^0(X \times_{\Spec(R)} \Spec(R/\pi^n),
\mathcal{O}_{X \times_{\Spec(R)} \Spec(R/\pi^n)}) \\
& =
R^\wedge
\end{align*}
using the theorem on formal functions
(Cohomology of Schemes, Theorem \ref{coherent-theorem-formal-functions})
for the first and last equality and for example
More on Algebra, Lemma \ref{more-algebra-lemma-isomorphic-completions}
for the middle isomorphism. Since $H^0(X, \mathcal{L})$ is a finite
$R$-module and $R$ is a discrete valuation ring, this means that
$H^0(X, \mathcal{L})$ is free of rank $1$ as an $R$-module.
Let $s \in H^0(X, \mathcal{L})$ be a basis element.
Then tracing back through the isomorphisms above we see
that $s|_{X \times_{\Spec(R)} \Spec(R/\pi^n)}$ is a trivialization
for all $n$. Since the vanishing locus of $s$ is closed in $X$
and $X \to \Spec(R)$ is proper we conclude that the vanishing
locus of $s$ is empty as desired.
\end{proof}






\section{Semistable reduction}
\label{section-semistable-reduction}

\noindent
In this section we carefully define what we mean by semistable reduction.

\begin{example}
\label{example-blowup}
Let $R$ be a discrete valuation ring with uniformizer $\pi$.
Given $n \geq 0$, consider the ring map
$$
R \longrightarrow A = R[x, y]/(xy - \pi^n)
$$
Set $X = \Spec(A)$ and $S = \Spec(R)$.
If $n = 0$, then $X \to S$ is smooth.
For all $n$ the morphism $X \to S$ is at-worst-nodal
of relative dimension $1$ as defined in
Algebraic Curves, Section \ref{curves-section-families-nodal}.
If $n = 1$, then $X$ is regular, but if $n > 1$, then $X$ is not
regular as $(x, y)$ no longer generate the maximal ideal
$\mathfrak m = (\pi, x, y)$. To ameliorate the situation
in case $n > 1$ we
consider the blowup $b : X' \to X$ of $X$ in $\mathfrak m$.
See Divisors, Section \ref{divisors-section-blowing-up}.
By construction $X'$ is covered by three affine pieces
corresponding to the blowup algebras $A[\frac{\mathfrak m}{\pi}]$,
$A[\frac{\mathfrak m}{x}]$, and $A[\frac{\mathfrak m}{y}]$.

\medskip\noindent
The algebra $A[\frac{\mathfrak m}{\pi}]$ has generators
$x' = x/\pi$ and $y' = y/\pi$ and $x'y' = \pi^{n - 2}$.
Thus this part of $X'$ is the spectrum of $R[x', y'](x'y' - \pi^{n - 2})$.

\medskip\noindent
The algebra $A[\frac{\mathfrak m}{x}]$ has generators $x$,
$u = \pi/x$ subject to the relation $xu - \pi$. Note that this ring
contains $y/x = \pi^n/x^2 = u^2\pi^{n - 2}$. Thus this part of
$X'$ is regular.

\medskip\noindent
By symmetry the case of the algebra $A[\frac{\mathfrak m}{y}]$ is
the same as the case of $A[\frac{\mathfrak m}{x}]$.

\medskip\noindent
Thus we see that $X' \to S$ is at-worst-nodal of relative dimension $1$
and that $X'$ is regular, except for one point which has an
affine open neighbourhood exactly as above but with $n$ replaced by $n - 2$.
Using induction on $n$ we conclude that there is a sequence of
blowing ups in closed points
$$
X_{\lfloor n/2 \rfloor} \to \ldots \to X_1 \to X_0 = X
$$
such that $X_{\lfloor n/2 \rfloor} \to S$ is
at-worst-nodal of relative dimension $1$ and
$X_{\lfloor n/2 \rfloor}$ is regular.
\end{example}

\begin{lemma}
\label{lemma-etale-local-at-worst-nodal}
Let $R$ be a discrete valuation ring. Let $X$ be a scheme which is
at-worst-nodal of relative dimension $1$ over $R$.
Let $x \in X$ be a point of the special fibre
of $X$ over $R$. Then there exists a commutative diagram
$$
\xymatrix{
X \ar[d] &
U \ar[r] \ar[d] \ar[l] &
\Spec(A) \ar[dl] \\
\Spec(R) &
\Spec(R') \ar[l]
}
$$
where $R \subset R'$ is an \'etale extension of discrete valuation rings,
the morphism $U \to X$ is \'etale, the morphism $U \to \Spec(A)$ is \'etale,
there is a point $x' \in U$ mapping to $x$, and
$$
A = R'[u, v]/(uv)
\quad\text{or}\quad
A = R'[u, v]/(uv - \pi^n)
$$
where $n \geq 0$ and $\pi \in R'$ is a uniformizer.
\end{lemma}

\begin{proof}
We have already proved this lemma in much greater generality, see
Algebraic Curves, Lemma \ref{curves-lemma-etale-local-structure-nodal-family}.
All we have to do here is to translate the statement
given there into the statement given above.

\medskip\noindent
First, if the morphism $X \to \Spec(R)$ is smooth at $x$,
then we can find an \'etale morphism $U \to \mathbf{A}^1_R = \Spec(R[u])$ for
some affine open neighbourhood $U \subset X$ of $x$. This is
Morphisms, Lemma \ref{morphisms-lemma-smooth-etale-over-affine-space}.
After replacing the coordinate $u$ by $u + 1$ if necessary, we may
assume that $x$ maps to a point in the standard open
$D(u) \subset \mathbf{A}^1_R$. Then $D(u) = \Spec(A)$ with
$A = R[u, v]/(uv - 1)$ and we see that the result is true in this case.

\medskip\noindent
Next, assume that $x$ is a singular point of the fibre. Then we may apply
Algebraic Curves, Lemma \ref{curves-lemma-etale-local-structure-nodal-family}
to get a diagram
$$
\xymatrix{
X \ar[d] &
U \ar[rr] \ar[l] \ar[rd] & &
W \ar[r] \ar[ld] &
\Spec(\mathbf{Z}[u, v, a]/(uv - a)) \ar[d] \\
\Spec(R) & &
V \ar[ll] \ar[rr] & & \Spec(\mathbf{Z}[a])
}
$$
with all the properties mentioned in the statement of the cited lemma.
Let $x' \in U$ be the point mapping to $x$ promised by the lemma.
First we shrink $V$ to an affine neighbourhood of the image of $x'$.
Say $V = \Spec(R')$. Then $R \to R'$ is \'etale. Since $R$ is a
discrete valuation ring, we see that $R'$ is a finite
product of quasi-local Dedekind domains (use
More on Algebra, Lemma \ref{more-algebra-lemma-Dedekind-etale-extension}).
Hence (for example using prime avoidance) we find a standard
open $D(f) \subset V = \Spec(R')$ containing the image of $x'$
such that $R'_f$ is a discrete valuation ring.
Replacing $R'$ by $R'_f$ we reach the situation where
$V = \Spec(R')$ with $R \subset R'$ an \'etale extension of
discrete valuation rings (extensions of discrete valuation rings
are defined in More on Algebra, Definition
\ref{more-algebra-definition-extension-discrete-valuation-rings}).

\medskip\noindent
The morphism $V \to \Spec(\mathbf{Z}[a])$ is determined by
the image $h$ of $a$ in $R'$. Then $W = \Spec(R'[u, v]/(uv - h))$.
Thus the lemma holds with
$A = R'[u, v]/(uv - h)$. If $h = 0$ then we clearly
obtain the first case mentioned in the lemma. If $h \not = 0$
then we may write $h = \epsilon \pi^n$ for some $n \geq 0$
where $\epsilon$ is a unit of $R'$. Changing coordinates
$u_{new} = \epsilon u$ and $v_{new} = v$ we obtain the second
isomorphism type of $A$ listed in the lemma.
\end{proof}

\begin{lemma}
\label{lemma-blowup-at-worst-nodal}
Let $R$ be a discrete valuation ring. Let $X$ be a quasi-compact scheme which
is at-worst-nodal of relative dimension $1$ with smooth generic fibre over $R$.
Then there exists $m \geq 0$ and a sequence
$$
X_m \to \ldots \to X_1 \to X_0 = X
$$
such that
\begin{enumerate}
\item $X_{i + 1} \to X_i$ is the blowing up of a closed point
$x_i$ where $X_i$ is singular,
\item $X_i \to \Spec(R)$ is at-worst-nodal of relative dimension $1$,
\item $X_m$ is regular.
\end{enumerate}
\end{lemma}

\noindent
A slightly stronger statement (also true) would be that no matter how
you blow up in singular points you eventually end up with a resolution
and all the intermediate blowups are
at-worst-nodal of relative dimension $1$ over $R$.

\begin{proof}
Since $X$ is quasi-compact we see that the special fibre $X_k$ is quasi-compact.
Since the singularities of $X_k$ are at-worst-nodal, we see
that $X_k$ has a finite number of nodes and is otherwise
smooth over $k$. As $X \to \Spec(R)$ is flat with smooth generic
fibre it follows that $X$ is smooth over $R$ except at the
finite number of nodes of $X_k$
(use Morphisms, Lemma \ref{morphisms-lemma-smooth-at-point}).
It follows that $X$ is regular at every point except for possibly
the nodes of its special fibre
(see Algebra, Lemma \ref{algebra-lemma-regular-goes-up}).
Let $x \in X$ be such a node.
Choose a diagram
$$
\xymatrix{
X \ar[d] &
U \ar[r] \ar[d] \ar[l] &
\Spec(A) \ar[dl] \\
\Spec(R) &
\Spec(R') \ar[l]
}
$$
as in Lemma \ref{lemma-etale-local-at-worst-nodal}.
Observe that the case $A = R'[u, v]/(uv)$ cannot
occur, as this would mean that the generic fibre of
$X/R$ is singular (tiny detail omitted). Thus $A = R'[u, v]/(uv - \pi^n)$
for some $n \geq 0$. Since $x$ is a singular point,
we have $n \geq 2$, see discussion in
Example \ref{example-blowup}.

\medskip\noindent
After shrinking $U$ we may assume there is
a unique point $u \in U$ mapping to $x$.
Let $w \in \Spec(A)$ be the image of $u$.
We may also assume that $u$ is the unique point of $U$
mapping to $w$.
Since the two horizontal arrows are \'etale
we see that $u$, viewed as a closed subscheme of $U$,
is the scheme theoretic inverse image of $x \in X$ and the
scheme theoretic inverse image of $w \in \Spec(A)$.
Since blowing up commutes with flat base change
(Divisors, Lemma \ref{divisors-lemma-flat-base-change-blowing-up})
we find a commutative diagram
$$
\xymatrix{
X' \ar[d] &
U' \ar[l] \ar[d] \ar[r] &
W' \ar[d] \\
X & U \ar[l] \ar[r] & \Spec(A)
}
$$
with cartesian squares where the vertical arrows are the blowing
up of $x, u, w$ in $X, U, \Spec(A)$. The scheme $W'$ was described
in Example \ref{example-blowup}. We saw there that $W'$
at-worst-nodal of relative dimension $1$ over $R'$. Thus
$W'$ is at-worst-nodal of relative dimension $1$ over $R$
(Algebraic Curves, Lemma \ref{curves-lemma-nodal-family-postcompose-etale}).
Hence $U'$ is at-worst-nodal of relative dimension $1$ over $R$ (see
Algebraic Curves, Lemma \ref{curves-lemma-nodal-family-etale-local-source}).
Since $X' \to X$ is an isomorphism over the complement of $x$,
we conclude the same thing is true of $X'/R$ (by
Algebraic Curves, Lemma \ref{curves-lemma-nodal-family-etale-local-source}
again).

\medskip\noindent
Finally, we need to argue that after doing a finite number
of these blowups we arrive at a regular model $X_m$.
This is rather clear because the ``invariant'' $n$ decreases by $2$
under the blowup described above, see computation in
Example \ref{example-blowup}.
However, as we want to avoid precisely defining this invariant
and establishing its properties, we in stead argue as follows.
If $n = 2$, then $W'$ is regular and hence $X'$
is regular at all points lying over $x$ and we have
decreased the number of singular points of $X$ by $1$.
If $n > 2$, then the unique singular point $w'$ of $W'$ lying over $w$
has $\kappa(w) = \kappa(w')$. Hence $U'$ has a unique
singular point $u'$ lying over $u$ with $\kappa(u) = \kappa(u')$.
Clearly, this implies that $X'$ has a unique singular point $x'$
lying over $x$, namely the image of $u'$. Thus we can
argue exactly as above that we get a commutative diagram
$$
\xymatrix{
X'' \ar[d] &
U'' \ar[l] \ar[d] \ar[r] &
W'' \ar[d] \\
X' & U' \ar[l] \ar[r] & W'
}
$$
with cartesian squares where the vertical arrows are the blowing
up of $x', u', w'$ in $X', U', W'$. Continuing like this we get
a compatible sequence of blowups which stops after
$\lfloor n/2 \rfloor$ steps. At the completion of this process
the scheme $X^{(\lfloor n/2 \rfloor)}$ will have one fewer
singular point than $X$. Induction on the number of singular
points completes the proof.
\end{proof}

\begin{lemma}
\label{lemma-blowdown-at-worst-nodal}
Let $R$ be a discrete valuation ring with fraction field $K$
and residue field $k$. Assume $X \to \Spec(R)$ is
at-worst-nodal of relative dimension $1$ over $R$.
Let $X \to X'$ be the contraction of an
exceptional curve $E \subset X$ of the first kind.
Then $X'$ is at-worst-nodal of relative dimension $1$ over $R$.
\end{lemma}

\begin{proof}
Namely, let $x' \in X'$ be the image of $E$.
Then the only issue is to see that $X' \to \Spec(R)$
is at-worst-nodal of relative dimension $1$
in a neighbourhood of $x'$.
The closed fibre of $X \to \Spec(R)$ is reduced, hence
$\pi \in R$ vanishes to order $1$ on $E$.
This immediately implies that
$\pi$ viewed as an element of
$\mathfrak m_{x'} \subset \mathcal{O}_{X', x'}$ but
is not in $\mathfrak m_{x'}^2$.
Since $\mathcal{O}_{X', x'}$ is regular of
dimension $2$ (by definition of contractions in
Resolution of Surfaces, Section \ref{resolve-section-minus-one}),
this implies that $\mathcal{O}_{X'_k, x'}$
is regular of dimension $1$
(Algebra, Lemma \ref{algebra-lemma-regular-ring-CM}).
On the other hand, the curve $E$ has to meet at
least one other component, say $C$ of the closed fibre $X_k$.
Say $x \in E \cap C$. Then $x$ is a node of the special
fibre $X_k$ and hence $\kappa(x)/k$ is finite separable,
see Algebraic Curves, Lemma \ref{curves-lemma-nodal}.
Since $x \mapsto x'$ we conclude that $\kappa(x')/k$
is finite separable.
By Algebra, Lemma \ref{algebra-lemma-separable-smooth}
we conclude that $X'_k \to \Spec(k)$ is smooth
in an open neighbourhood of $x'$.
Combined with flatness, this proves that
$X' \to \Spec(R)$ is smooth in a neighbourhood of $x'$
(Morphisms, Lemma \ref{morphisms-lemma-smooth-at-point}).
This finishes the proof as a smooth morphism of
relative dimension $1$ is at-worst-nodal of relative
dimension $1$
(Algebraic Curves, Lemma \ref{curves-lemma-smooth-relative-dimension-1}).
\end{proof}

\begin{lemma}
\label{lemma-semistable}
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
The following are equivalent
\begin{enumerate}
\item there exists a proper model of $C$ which is
at-worst-nodal of relative dimension $1$ over $R$,
\item there exists a minimal model of $C$ which is at-worst-nodal
of relative dimension $1$ over $R$, and
\item any minimal model of $C$ is at-worst-nodal
of relative dimension $1$ over $R$.
\end{enumerate}
\end{lemma}

\begin{proof}
To make sense out of this statement, recall that a
minimal model is defined as a regular proper model
without exceptional curves of the first kind
(Definition \ref{definition-minimal-model}),
that minimal models exist
(Proposition \ref{proposition-exists-minimal-model}), and
that minimal models are unique if the genus
of $C$ is $> 0$ (Lemma \ref{lemma-minimal-model-unique}).
Keeping this in mind the implications (2) $\Rightarrow$ (1)
and (3) $\Rightarrow$ (2) are clear.

\medskip\noindent
Assume (1). Let $X$ be a proper model of $C$ which is
at-worst-nodal of relative dimension $1$ over $R$.
Applying Lemma \ref{lemma-blowup-at-worst-nodal}
we see that we may assume $X$ is regular as well.
Let
$$
X = X_m \to X_{m - 1} \to \ldots \to X_1 \to X_0
$$
be as in Lemma \ref{lemma-pre-exists-minimal-model}.
By Lemma \ref{lemma-blowdown-at-worst-nodal} and induction
this implies $X_0$ is at-worst-nodal of relative dimension $1$ over $R$.

\medskip\noindent
To finish the proof we have to show that (2) implies (3).
This is clear if the genus of $C$ is $> 0$, since then
the minimal model is unique (see discussion above).
On the other hand, if the minimal model is not unique, then
the morphism $X \to \Spec(R)$ is smooth for any minimal model
as its special fibre will be isomorphic to $\mathbf{P}^1_k$
by Lemma \ref{lemma-nonuniqueness}.
\end{proof}

\begin{definition}
\label{definition-semistable}
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
We say that $C$ has {\it semistable reduction} if the equivalent
conditions of Lemma \ref{lemma-semistable} are satisfied.
\end{definition}

\begin{lemma}
\label{lemma-good}
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
The following are equivalent
\begin{enumerate}
\item there exists a proper smooth model for $C$,
\item there exists a minimal model for $C$ which is smooth over $R$,
\item any minimal model is smooth over $R$.
\end{enumerate}
\end{lemma}

\begin{proof}
If $X$ is a smooth proper model, then the special fibre is
connected (Lemma \ref{lemma-regular-model-connected})
and smooth, hence irreducible. This immediately implies that
it is minimal. Thus (1) implies (2). 
To finish the proof we have to show that (2) implies (3).
This is clear if the genus of $C$ is $> 0$, since then
the minimal model is unique (Lemma \ref{lemma-minimal-model-unique}).
On the other hand, if the minimal model is not unique, then
the morphism $X \to \Spec(R)$ is smooth for any minimal model
as its special fibre will be isomorphic to $\mathbf{P}^1_k$
by Lemma \ref{lemma-nonuniqueness}.
\end{proof}

\begin{definition}
\label{definition-good}
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
We say that $C$ has {\it good reduction} if the equivalent
conditions of Lemma \ref{lemma-good} are satisfied.
\end{definition}








\section{Semistable reduction in genus zero}
\label{section-semistable-reduction-genus-zero}

\noindent
In this section we prove the semistable reduction theorem
(Theorem \ref{theorem-semistable-reduction})
for genus zero curves.

\medskip\noindent
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
If the genus of $C$ is $0$, then $C$ is isomorphic to a conic,
see Algebraic Curves, Lemma \ref{curves-lemma-genus-zero}.
Thus there exists a finite separable extension $K'/K$ of
degree at most $2$ such that $C(K') \not = \emptyset$, see
Algebraic Curves, Lemma
\ref{curves-lemma-smooth-plane-curve-point-over-separable}.
Let $R' \subset K'$ be the integral closure of $R$, see
discussion in More on Algebra, Remark
\ref{more-algebra-remark-finite-separable-extension}.
We will show that $C_{K'}$ has semistable reduction
over $R'_{\mathfrak m}$ for each maximal ideal $\mathfrak m$ of $R'$
(of course in the current case there are at most two such ideals).
After replacing $R$ by $R'_{\mathfrak m}$ and $C$ by $C_{K'}$
we reduce to the case discussed in the next paragraph.

\medskip\noindent
In this paragraph $R$ is a discrete valuation ring with fraction field $K$,
$C$ is a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$,
of genus $0$, and $C$ has a $K$-rational point. In this case
$C \cong \mathbf{P}^1_K$ by
Algebraic Curves, Proposition \ref{curves-proposition-projective-line}.
Thus we can use $\mathbf{P}^1_R$ as a model and we see that
$C$ has both good and semistable reduction.

\begin{example}
\label{example-extension-necessary-genus-zero}
Let $R = \mathbf{R}[[\pi]]$ and consider the scheme
$$
X = V(T_1^2 + T_2^2 - \pi T_0^2) \subset \mathbf{P}^2_R
$$
The base change of $X$ to $\mathbf{C}[[\pi]]$ is isomorphic
to the scheme defined in Example \ref{example-nonunique-in-genus-zero}
because we have the factorization $T_1^2 + T_2^2 = (T_1 + iT_2)(T_1 - iT_2)$
over $\mathbf{C}$.
Thus $X$ is regular and its special fibre is irreducible yet singular,
hence $X$ is the unique minimal model of its generic fibre
(use Lemma \ref{lemma-nonuniqueness}).
It follows that an extension is needed even in genus $0$.
\end{example}



\section{Semistable reduction in genus one}
\label{section-semistable-reduction-genus-one}

\noindent
In this section we prove the semistable reduction theorem
(Theorem \ref{theorem-semistable-reduction}) for curves of genus one.
We suggest the reader first read the proof in the case of genus $\geq 2$
(Section \ref{section-semistable-reduction-genus-at-least-two}).
We are going to use as much as possible the classification of
minimal numerical types of genus $1$ given in
Lemma \ref{lemma-genus-one}.

\medskip\noindent
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
Assume the genus of $C$ is $1$.
Choose a prime $\ell \geq 7$ different from the characteristic of $k$.
Choose a finite separable extension $K'/K$ of
such that $C(K') \not = \emptyset$ and such that
$\Pic(C_{K'})[\ell] \cong (\mathbf{Z}/\ell \mathbf{Z})^{\oplus 2}$.
See
Algebraic Curves, Lemma \ref{curves-lemma-torsion-picard-becomes-visible}.
Let $R' \subset K'$ be the integral closure of $R$, see
discussion in More on Algebra, Remark
\ref{more-algebra-remark-finite-separable-extension}.
We may replace $R$ by $R'_{\mathfrak m}$ for some maximal ideal
$\mathfrak m$ in $R'$ and $C$ by $C_{K'}$. This
reduces us to the case discussed in the next paragraph.

\medskip\noindent
In the rest of this section
$R$ is a discrete valuation ring with fraction field $K$,
$C$ is a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$,
with genus $1$, having a $K$-rational point, and with
$\Pic(C)[\ell] \cong (\mathbf{Z}/\ell \mathbf{Z})^{\oplus 2}$
for some prime $\ell \geq 7$ different from the characteristic of $k$.
We will prove that $C$ has semistable reduction.

\medskip\noindent
Let $X$ be a minimal model for $C$, see
Proposition \ref{proposition-exists-minimal-model}.
Let $T = (n, m_i, (a_{ij}), w_i, g_i)$
be the numerical type associated to $X$
(Definition \ref{definition-numerical-type-model}).
Then $T$ is a minimal numerical type
(Lemma \ref{lemma-numerical-type-minimal-model}).
As $C$ has a rational point, there exists an $i$
such that $m_i = w_i = 1$ by Lemma \ref{lemma-numerical-type-rational-point}.
Looking at the classification of minimal numerical types
of genus $1$ in Lemma \ref{lemma-genus-one}
we see that $m = w = 1$ and that cases
(\ref{item-up4}),
(\ref{item-equal-down3}),
(\ref{item-up-up}),
(\ref{item-down-up}),
(\ref{item-up-equal-up}),
(\ref{item-down-equal-up}),
(\ref{item-triple-with-down}),
(\ref{item-equal-equal-down-equal}),
(\ref{item-up-equal-equal-up}),
(\ref{item-down-equal-equal-up}),
(\ref{item-triple-extended-down}),
(\ref{item-up-chain-equal-up}),
(\ref{item-down-chain-equal-up}),
(\ref{item-Dn-extended-down}) are disallowed (because there is no
index where both $w_i$ and $m_i$ is equal to $1$).
Let $e$ be the number of pairs $(i, j)$ with $i < j$ and
$a_{ij} > 0$. For the remaining cases we have
\begin{enumerate}
\item[(A)] $e = n - 1$ for cases
(\ref{item-one}),
(\ref{item-two-cycle}),
(\ref{item-equal-up3}),
(\ref{item-up-down}),
(\ref{item-up-equal-down}),
(\ref{item-triple-with-up}),
(\ref{item-equal-equal-up-equal}),
(\ref{item-up-equal-equal-down}),
(\ref{item-quadruple}),
(\ref{item-triple-extended-up}),
(\ref{item-up-chain-equal-down}),
(\ref{item-Dn-extended-up}),
(\ref{item-double-triple}),
(\ref{item-E6-completed}),
(\ref{item-E7-completed}), and
(\ref{item-E8-completed}), and
\item[(B)] $e = n$ for cases
(\ref{item-three-cycle}),
(\ref{item-four-cycle}),
(\ref{item-five-cycle}), and
(\ref{item-n-cycle}).
\end{enumerate}
We will argue these cases separately.

\medskip\noindent
Case (A). In this case $\Pic(T)[\ell]$ is trivial (the Picard group
of a numerical type is defined in Section \ref{section-picard-group}).
The vanishing follows as $\Pic(T) \subset \Coker(A)$
(Lemma \ref{lemma-picard-T-and-A}) and $\Coker(A)[\ell] = 0$ by
Lemma \ref{lemma-recurring-symmetric-integer} and the
fact that $\ell$ was chosen relatively prime to $a_{ij}$ and $m_i$.
By Lemmas \ref{lemma-sequence-torsion} and \ref{lemma-torsion-embeds}
we conclude that there is an embedding
$$
(\mathbf{Z}/\ell \mathbf{Z})^{\oplus 2} \subset \Pic((X_k)_{red})[\ell].
$$
By Algebraic Curves, Lemma \ref{curves-lemma-bound-torsion-simple} we obtain
$$
2 \leq \dim_k H^1((X_k)_{red}, \mathcal{O}_{(X_k)_{red}}) +
g_{geom}((X_k)_{red}/k)
$$
By Algebraic Curves, Lemmas \ref{curves-lemma-bound-geometric-genus} and
\ref{curves-lemma-bound-geometric-genus-curve}
we see that $g_{geom}((X_k)_{red}/k) \leq \sum w_ig_i$.
The assumptions of Lemma \ref{lemma-genus-reduction-smaller}
hold by Lemma \ref{lemma-numerical-type-rational-point} and we
conclude that we have
$\dim_k H^1((X_k)_{red}, \mathcal{O}_{(X_k)_{red}}) \leq g = 1$.
Combining these we see
$$
2 \leq 1 + \sum w_i g_i
$$
Looking at the list we conclude that the numerical type is given by
$n = 1$, $w_1 = m_1 = g_1 = 1$. Because we have equality everywhere
we see that $g_{geom}(C_1/k) = 1$. On the other hand, we know
that $C_1$ has a $k$-rational point $x$ such that $C_1 \to \Spec(k)$
is smooth at $x$. It follows that $C_1$ is geometrically integral
(Varieties, Lemma \ref{varieties-lemma-variety-with-smooth-rational-point}).
Thus $g_{geom}(C_1/k) = 1$ is both equal to the genus of the normalization
of $C_{1, \overline{k}}$ and the genus of $C_{1, \overline{k}}$.
It follows that the normalization morphism
$C_{1, \overline{k}}^\nu \to C_{1, \overline{k}}$
is an isomorphism
(Algebraic Curves, Lemma \ref{curves-lemma-genus-normalization}).
We conclude that $C_1$ is smooth over $k$ as desired.

\medskip\noindent
Case (B). Here we only conclude that there is an embedding
$$
\mathbf{Z}/\ell \mathbf{Z} \subset \Pic(X_k)[\ell]
$$
From the classification of types we see that $m_i = w_i = 1$ and $g_i = 0$
for each $i$. Thus each $C_i$ is a genus zero curve over $k$.
Moreover, for each $i$ there is a $j$ such that
$C_i \cap C_j$ is a $k$-rational point. Then it follows that
$C_i \cong \mathbf{P}^1_k$ by
Algebraic Curves, Proposition \ref{curves-proposition-projective-line}.
In particular, since $X_k$ is the scheme theoretic union of the
$C_i$ we see that $X_{\overline{k}}$ is the
scheme theoretic union of the $C_{i, \overline{k}}$.
Hence $X_{\overline{k}}$ is a reduced connected proper
scheme of dimension $1$ over $\overline{k}$ with $\dim_{\overline{k}}
H^1(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}}) = 1$.
Also, by Varieties, Lemma \ref{varieties-lemma-change-fields-pic}
and the above we still have
$$
\dim_{\mathbf{F}_\ell}(\Pic(X_{\overline{k}}) \geq 1
$$
By Algebraic Curves, Proposition
\ref{curves-proposition-torsion-picard-reduced-proper}
we see that $X_{\overline{k}}$ has at only multicross singularities.
But since $X_k$ is Gorenstein (Lemma \ref{lemma-gorenstein}),
so is $X_{\overline{k}}$ (Duality for Schemes, Lemma
\ref{duality-lemma-gorenstein-base-change}).
We conclude $X_{\overline{k}}$ is at-worst-nodal by
Algebraic Curves, Lemma \ref{curves-lemma-multicross-gorenstein-is-nodal}.
This finishes the proof in case (B).

\begin{example}
\label{example-extension-necessary-genus-one}
Let $k$ be an algebraically closed field. Let $Z$ be a smooth projective curve
over $k$ of positive genus $g$. Let $n \geq 1$ be an integer prime to the
characteristic of $k$. Let $\mathcal{L}$ be an
invertible $\mathcal{O}_Z$-module of order $n$, see
Algebraic Curves, Lemma \ref{curves-lemma-torsion-picard-smooth-projective}.
Pick an isomorphism $\varphi : \mathcal{L}^{\otimes n} \to \mathcal{O}_Z$.
Set $R = k[[\pi]]$ with fraction field $K = k((\pi))$. Denote $Z_R$
the base change of $Z$ to $R$. Let $\mathcal{L}_R$
be the pullback of $\mathcal{L}$ to $Z_R$.
Consider the finite flat morphism
$$
p : X \longrightarrow Z_R
$$
such that
$$
p_*\mathcal{O}_X =
\text{Sym}^*_{\mathcal{O}_{Z_R}}(\mathcal{L}_R)/(\varphi - \pi) =
\mathcal{O}_{Z_R} \oplus \mathcal{L}_R \oplus
\mathcal{L}_R^{\otimes 2} \oplus \ldots \oplus \mathcal{L}_R^{\otimes n - 1}
$$
More precisely, if $U = \Spec(A) \subset Z$ is an affine open
such that $\mathcal{L}|_U$ is trivialized by a section $s$
with $\varphi(s^{\otimes n}) = f$ (with $f$ a unit), then
$$
p^{-1}(U_R) = \Spec\left(
(A \otimes_R R[[\pi]])[x]/(x^n - \pi f)
\right)
$$
The reader verifies that the morphism $X_K \to Z_K$ of
generic fibres is finite \'etale. Looking at the description
of the structure sheaf we see that $H^0(X, \mathcal{O}_X) = R$
and $H^0(X_K, \mathcal{O}_{X_K}) = K$. By Riemann-Hurwitz
(Algebraic Curves, Lemma \ref{curves-lemma-rhe})
the genus of $X_K$ is $n(g - 1) + 1$. In particular $X_K$
has genus $1$, if $Z$ has genus $1$.
On the other hand, the scheme $X$ is regular
by the local equation above and the special fibre $X_k$ is
$n$ times the reduced special fibre as an effective Cartier divisor.
It follows that any finite extension $K'/K$ over which
$X_K$ attains semistable reduction has to ramify
with ramification index at least $n$ (some details omitted).
Thus there does not exist a universal bound for the
degree of an extension over which a genus $1$ curve attains
semistable reduction.
\end{example}






\section{Semistable reduction in genus at least two}
\label{section-semistable-reduction-genus-at-least-two}

\noindent
In this section we prove the semistable reduction theorem
(Theorem \ref{theorem-semistable-reduction}) for curves of genus $\geq 2$.
Fix $g \geq 2$.

\medskip\noindent
Let $R$ be a discrete valuation ring with fraction field $K$.
Let $C$ be a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
Assume the genus of $C$ is $g$.
Choose a prime $\ell > 768g$ different from the characteristic of $k$.
Choose a finite separable extension $K'/K$ of
such that $C(K') \not = \emptyset$ and such that
$\Pic(C_{K'})[\ell] \cong (\mathbf{Z}/\ell \mathbf{Z})^{\oplus 2g}$.
See
Algebraic Curves, Lemma \ref{curves-lemma-torsion-picard-becomes-visible}.
Let $R' \subset K'$ be the integral closure of $R$, see
discussion in More on Algebra, Remark
\ref{more-algebra-remark-finite-separable-extension}.
We may replace $R$ by $R'_{\mathfrak m}$ for some maximal ideal
$\mathfrak m$ in $R'$ and $C$ by $C_{K'}$. This
reduces us to the case discussed in the next paragraph.

\medskip\noindent
In the rest of this section
$R$ is a discrete valuation ring with fraction field $K$,
$C$ is a smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$,
with genus $g$, having a $K$-rational point, and with
$\Pic(C)[\ell] \cong (\mathbf{Z}/\ell \mathbf{Z})^{\oplus 2g}$
for some prime $\ell \geq 768g$ different from the characteristic of $k$.
We will prove that $C$ has semistable reduction.

\medskip\noindent
In the rest of this section we will use without further mention
that the conclusions of Lemma \ref{lemma-numerical-type-rational-point}
are true.

\medskip\noindent
Let $X$ be a minimal model for $C$, see
Proposition \ref{proposition-exists-minimal-model}.
Let $T = (n, m_i, (a_{ij}), w_i, g_i)$
be the numerical type associated to $X$
(Definition \ref{definition-numerical-type-model}).
Then $T$ is a minimal numerical type of genus $g$
(Lemma \ref{lemma-numerical-type-minimal-model}).
By Proposition \ref{proposition-bound-picard-group}
we have
$$
\dim_{\mathbf{F}_\ell} \Pic(T)[\ell] \leq g_{top}
$$
By Lemmas \ref{lemma-sequence-torsion} and \ref{lemma-torsion-embeds}
we conclude that there is an embedding
$$
(\mathbf{Z}/\ell \mathbf{Z})^{\oplus 2g - g_{top}}
\subset \Pic((X_k)_{red})[\ell].
$$
By Algebraic Curves, Lemma \ref{curves-lemma-bound-torsion-simple} we obtain
$$
2g - g_{top} \leq
\dim_k H^1((X_k)_{red}, \mathcal{O}_{(X_k)_{red}}) + g_{geom}(X_k/k)
$$
By Lemmas \ref{lemma-genus-reduction-smaller} and
\ref{lemma-genus-reduction-bigger-than}
we have
$$
g \geq \dim_k H^1((X_k)_{red}, \mathcal{O}_{(X_k)_{red}}) \geq
g_{top} + g_{geom}(X_k/k)
$$
Elementary number theory tells us that the only way these $3$
inequalities can hold is if they are all equalities.
Looking at Lemma \ref{lemma-genus-reduction-smaller}
we conclude that $m_i = 1$ for all $i$.
Looking at Lemma \ref{lemma-equality-genus-reduction-bigger-than}
we conclude that every irreducible component of $X_k$
is smooth over $k$.

\medskip\noindent
In particular, since $X_k$ is the scheme theoretic union of its
irreducible components $C_i$ we see that $X_{\overline{k}}$ is the
scheme theoretic union of the $C_{i, \overline{k}}$.
Hence $X_{\overline{k}}$ is a reduced connected proper
scheme of dimension $1$ over $\overline{k}$ with $\dim_{\overline{k}}
H^1(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}}) = g$.
Also, by Varieties, Lemma \ref{varieties-lemma-change-fields-pic}
and the above we still have
$$
\dim_{\mathbf{F}_\ell}(\Pic(X_{\overline{k}})[\ell])
\geq 2g - g_{top} =
\dim_{\overline{k}} H^1(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}})
+ g_{geom}(X_{\overline{k}})
$$
By Algebraic Curves, Proposition
\ref{curves-proposition-torsion-picard-reduced-proper}
we see that $X_{\overline{k}}$ has at only multicross singularities.
But since $X_k$ is Gorenstein (Lemma \ref{lemma-gorenstein}),
so is $X_{\overline{k}}$ (Duality for Schemes, Lemma
\ref{duality-lemma-gorenstein-base-change}).
We conclude $X_{\overline{k}}$ is at-worst-nodal by
Algebraic Curves, Lemma \ref{curves-lemma-multicross-gorenstein-is-nodal}.
This finishes the proof.










\section{Semistable reduction for curves}
\label{section-semistable-reduction-theorem}

\noindent
In this section we finish the proof of the theorem.
For $g \geq 2$ let $768g < \ell' < \ell$
be the first two primes $> 768g$ and set
\begin{equation}
\label{equation-bound}
B_g = (2g - 2)(\ell^{2g})!
\end{equation}
The precise form of $B_g$ is unimportant; the point we are trying
to make is that it depends only on $g$.

\begin{theorem}
\label{theorem-semistable-reduction}
\begin{reference}
\cite[Corollary 2.7]{DM}
\end{reference}
Let $R$ be a discrete valuation ring with fraction field $K$. Let $C$ be a
smooth projective curve over $K$ with $H^0(C, \mathcal{O}_C) = K$.
Then there exists an extension of discrete valuation rings
$R \subset R'$ which induces a finite separable extension of
fraction fields $K'/K$ such that $C_{K'}$ has semistable reduction.
More precisely, we have the following
\begin{enumerate}
\item If the genus of $C$ is zero, then there exists a degree $2$
separable extension $K'/K$ such that $C_{K'} \cong \mathbf{P}^1_{K'}$
and hence $C_{K'}$ is isomorphic to the generic fibre of the
smooth projective scheme $\mathbf{P}^1_{R'}$ over the integral closure
$R'$ of $R$ in $K'$.
\item If the genus of $C$ is one, then there exists a finite separable
extension $K'/K$ such that $C_{K'}$ has semistable reduction
over $R'_\mathfrak m$ for every maximal ideal $\mathfrak m$
of the integral closure $R'$ of $R$ in $K'$. Moreover, the special
fibre of the (unique) minimal model of $C_{K'}$ over $R'_\mathfrak m$
is either a smooth genus one curve or a cycle of rational curves.
\item If the genus $g$ of $C$ is greater than one, then there exists a
finite separable extension $K'/K$ of degree at most
$B_g$ (\ref{equation-bound}) such that $C_{K'}$ has semistable reduction
over $R'_\mathfrak m$ for every maximal ideal $\mathfrak m$
of the integral closure $R'$ of $R$ in $K'$.
\end{enumerate}
\end{theorem}

\begin{proof}
For the case of genus zero, see
Section \ref{section-semistable-reduction-genus-zero}.
For the case of genus one, see
Section \ref{section-semistable-reduction-genus-one}.
For the case of genus greater than one, see
Section \ref{section-semistable-reduction-genus-at-least-two}.
To see that we have a bound on the degree $[K' : K]$
you can use the bound on the degree of the extension needed
to make all $\ell$ or $\ell'$ torsion visible proved in
Algebraic Curves, Lemma \ref{curves-lemma-torsion-picard-becomes-visible}.
(The reason for using $\ell$ and $\ell'$ is that we need to
avoid the characteristic of the residue field $k$.)
\end{proof}

\begin{remark}[Improving the bound]
\label{remark-improving-bound}
Results in the literature suggest that one can improve the bound
given in the statement of Theorem \ref{theorem-semistable-reduction}.
For example, in \cite{DM} it is shown that semistable reduction
of $C$ and its Jacobian are the same thing if the residue field is perfect
and presumably this is true for general residue fields as well.
For an abelian variety we have semistable reduction if the action of Galois
on the $\ell$-torsion is trivial for any $\ell \geq 3$ not equal to the
residue characteristic. Thus we can presumably choose $\ell = 5$
in the formula (\ref{equation-bound}) for $B_g$
(but the proof would take a lot more work; if we ever need this
we will make a precise statement and provide a proof here).
\end{remark}




\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}
